home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / EnterAct 3.5 / EnterAct 3 Manual < prev    next >
Encoding:
Text File  |  1995-12-12  |  331.3 KB  |  8,561 lines  |  [TEXT/KEEN]

  1. ****************ENTERACT™ USER’s MANUAL*****************
  2. Copyright © 1991-1995 by Dynabyte. EnterAct 3.5, by Ken Earle.
  3. All rights reserved.
  4. Thanks to Zelko Jagaric, Wai Choi, Rob Gibson, Steve Olsen,
  5. Jean François Cassan, Mark Wong, Scott Jenson, Bill Sears, Sandra Lakin
  6. and many others for advice, help, and constructive abuse.
  7.  
  8.                 (<Option>zoom to open this window up)
  9. You can reach me at:
  10. Ken Earle
  11. 697 Spadina Ave
  12. Toronto, ON
  13. CANADA
  14. M5S 2J1
  15.  
  16. 73073,2166                                    via CompuServe,
  17. 73073.2166@compuserve.com        via InterNet.
  18.  
  19.  
  20. The 68K version of EnterAct (3.5) is FREE.
  21. There is, as yet, no native PPC version.
  22.  
  23. "hAWK", "Read Resource", their associated source code and
  24. manuals, and the Drag_on Modules interface are yours to keep,
  25. free, no matter what. They are governed by the Free Software
  26. Foundation's "copyleft", as described in the document "copying
  27. hAWK", included with your EnterAct package.
  28.  
  29. You may distribute full copies of EnterAct (omitting no files from
  30. the compressed archive that comprises EnterAct), provided you
  31. do not charge for EnterAct itself.
  32.  
  33. EnterAct is an editor for creating, maintaining, and reviewing C
  34. and C++ code. EnterAct has many capabilities (most notably
  35. real-time automatic definition and prototype display, even out of
  36. first-draft code) that just aren’t "out there" yet. This is a
  37. short-lived product, intended to fill the gap until EnterAct’s best
  38. features are available elsewhere. Let’s hope it doesn’t take more
  39. than a year or two. That having been said, please note that
  40. EnterAct itself is a solid editor. It’s been around since 1989.
  41.  
  42. If you just want to use EnterAct as a "definition viewer" to help
  43. out some other editor, see the section
  44. §    EnterAct as a "definition finder"
  45. (to get there, use "Enter Selection" and "Find Again" on the above line).
  46.  
  47. Metrowerks codewarriors, please see Appendix 5.
  48. Symantec lightspeeders, please see Appendix 4.
  49. (<Option> click in the title bar here)
  50. MPWers who can't afford ObjectMaster, start doing your happy dance.
  51.  
  52. For the very very impatient:
  53. 1    Put EnterAct and the "Drag_on Modules" folder at the top
  54.     level of your most-used compiler folder. TPM users, follow
  55.     instructions in your Symantec manual for using a third-party editor.
  56. 2    Start up EnterAct and make a project, just as with THINK C™ etc.
  57.     Select your system folder for <header> files in the next dialog that
  58.     appears, or Cancel to use the folder that contains EnterAct.
  59. 3    Use "Add All in Folder" etc to add files. Hold down the <Shift>
  60.     key and that menu item changes to "Add All in Subfolders".
  61. 4    "Update Dictionary". See "DON’T GIVE UP" a page or so below
  62.     if you run into a problem. Usually problems are rare, fixes are easy.
  63. 5    Pick the "AutoLook" command.
  64. 6    Open a project source file and browse around. Double-click on
  65.     or click just after any name that you’d like to see a definition
  66.     or prototype for. Watch the AutoLook window. Press <Enter>.
  67. 7    Come on back here, and learn about all the other good stuff
  68.     (persistent lookup windows, cross-referencing, Automark,
  69.     hyperlinks, access to the hAWK language, persistent undo, etc).
  70.  
  71. For the just very impatient: see "EnterAct in brief" instead of this.
  72. Included there are details on using EnterAct as a "definition viewer"
  73. while working with other editors.
  74.  
  75.  
  76. Network and team users please read this
  77. -------------------------------------------------------------
  78. EnterAct does not keep files open, except when in the act of
  79. reading and writing them. EnterAct is, however, SourceServer
  80. aware, and won't allow changes to a file that have been checked
  81. out as read-only unless you issue a "Modify Read Only" command
  82. or enable EnterAct's "ignore ckid's" option.
  83. So use (multiple copies of) EnterAct only if you have some way of
  84. ensuring that you won't have several people working on the same
  85. copy of a file at the same time (such as SourceServer/Projector).
  86.  
  87. System requirements
  88. -------------------------------------------------------------
  89. System 7 required. Mac II speed (that is, a 68020 running
  90. at 16 mHz) is recommended if your project contains more than about
  91. 500K of text in source and header files combined. A hard disk is a
  92. practical necessity. A large screen (>= 16 inches) will
  93. allow you to take better advantage of EnterAct’s information
  94. lookup capabilities. EnterAct requires 2 Meg of memory, 
  95. with 4 being more typical, 6-8 for big projects. The price of power.
  96.  
  97. EnterAct is intended for creating, maintaining, and reviewing Symantec
  98. C/C++, MPW C/C++, and MetroWerks Codewarrior C/C++ code. You may
  99. find one or two small difficulties right at first (see DON’t GIVE UP
  100. just below) but you should find that EnterAct understands your
  101. C/C++, and even your “C--” (first-draft stuff).
  102.  
  103. Feel free to print this manual (use EnterAct so the pictures will print).
  104. The benefits of having it on disk are that you can use Find on the
  105. table of contents and elsewhere to jump to topics of interest, and
  106. that this document is marked with chapter headings—hold down the
  107. <Command> key and click in the title bar to view the marker menu for
  108. this file.
  109.  
  110. ****************************************************
  111. DON’T GIVE UP if you attempt to "Update Dictionary" and the parser
  112. complains about your perfectly good source: quite often, this first
  113. problem will be your last, and easy to fix. (Note with v3.0.5
  114. EnterAct is smarter about handling complicated preprocessor
  115. tangles -- if you get stuck, please let me know and I
  116. will try to fix the problem at my end. My tech support address
  117. is just below. As of this writing EnterAct runs into problems
  118. only with rather pathological practices, such as duplicated
  119. comment starts [this check can be turned off in the Options
  120. dialog], aliases for keywords, and one or two other oddities
  121. as described in the "Source code restrictions" chapter.)
  122.  
  123. The commonest problem involves conditional #defines which
  124. duplicate important punctuation (here '{'), such as
  125.     #ifdef GO_LONG
  126.     long GetArrayIndex(void) {
  127.     #else
  128.     short GetArrayIndex(void) {
  129.     #endif
  130. —although this particular example doesn't bother EnterAct. If
  131. you do run into a problem it will almost certainly be something
  132. similar, involving duplicated punctuation such as the two '{'s above.
  133. The fix for this sort of problem is to recast the definition slightly
  134. to remove the duplicated punctuation:
  135.     #ifdef GO_LONG
  136.     long GetArrayIndex(void)
  137.     #else
  138.     short GetArrayIndex(void)
  139.     #endif
  140.     {
  141.  
  142. Similarly, if a construction such as
  143.     struct Thing
  144.     #ifdef _cplus_
  145.     : public BaseThing
  146.     #endif
  147.     {....
  148. causes a problem it will work fine if recast as
  149.     #ifdef _cplus_
  150.     struct Thing : public BaseThing
  151.     #else
  152.     struct Thing
  153.     #endif
  154.     {...
  155. although once again this example is handled correctly
  156. by EnterAct.
  157. (Note in this case the definition that appears first will be the
  158. one that appears in your Browser window.)
  159. Nested comment starts ( /*.../*...*/) will also cause the parser
  160. to hiccup. Best, fix the comment so it has one start and one end.
  161. Second best, pick "Options" from the Edit menu and deselect
  162. "Detect nested comment starts".
  163. ****************************************************
  164.  
  165. CONTENTS
  166. (Each line in quotes «» below is a "Go to" link: to go to a chapter,
  167. click on its line and select "Go to" from the Search menu.
  168. For more on "Go to" links, see chapter 17.  These chapter links
  169. are available in the popup marker menu, which you can bring up
  170. by holding down the <Command> key and clicking in the title bar.
  171.  
  172. Section names are also listed here, though they are not links or
  173. markers: to go to a section, select the name including the '§', and
  174. then use "Enter Selection" and "Find Again" from the Search menu.
  175. While within a chapter, you can advance from section to section
  176. by searching for just the '§' character, which is an <Option><6>.)
  177.  
  178. «01   Introduction»
  179. «02   About EnterAct»
  180. §    When to use EnterAct
  181. §    An overview
  182. §    Looking ahead
  183. «03   Getting started»
  184. «04   Definitions and conventions»
  185. (chapter 05 has been deleted)
  186. «06   Whirlwind tour»
  187. «07   Source code restrictions»
  188. §    Why not just C?
  189. §    Aliases
  190. §    Obviously unnecessary parentheses
  191. §    Nested comment starts
  192. §    Preprocessor tangles
  193. §    All–or–nothing macro’s
  194. «08   Projects»
  195. §    Introduction
  196. §    Project files
  197. §    Creating a project
  198. §    Selecting your <system> folder
  199. §    Three panes—.c, .h, plain text
  200. §    Add Files—the one-at-a-time way
  201. §    Adding files from a list
  202. §    Add All In Folder—the fast way
  203. §    Add Mac Headers
  204. §    Add THINK Headers
  205. §    Add Standard C Headers
  206. §    The active pane
  207. §    Remove File
  208. §    Remove •'d Files
  209. §    Custom file extensions
  210. §    Distinguishing ".h" from <.h>
  211. §    Copy and search in the project window
  212. §    Project memory needs
  213. §    Multi-file selection
  214. §    Project context restoration
  215. §    Switching to other projects
  216. §    Tips
  217. «09   Dictionaries»
  218. §    Introduction
  219. §    What’s in a dictionary
  220. §    Building your dictionary
  221. §    Keeping it up to date
  222. §    How long will it take?
  223. §    Show Dictionary
  224. «10   Lookup»
  225. §    AutoLook
  226. §    Regular lookup (press <Enter>)
  227. §    <Enter> for lookup, advancing, scrolling
  228. §    Looking up the clip (press <Command><Enter>)
  229. §    Reverse lookup (press <Shift><Enter>)
  230. §    “Sounds like” lookup (press <Option><Enter>)
  231. §    Viewing other entries in lookup windows
  232. §    For faster lookup
  233. §    Hints with lookup
  234. §    Number of lookup windows
  235. §    Number of entries per lookup
  236. §    Keeping lookups around
  237. §    Looking up your notes
  238. §    EnterAct as a "definition finder" for other editors
  239. §    Looking it up with THINK Reference or Toolbox Assistant
  240. «11   Seeing where a term is defined»
  241. §    <Option>double–click
  242. §    Find Definition
  243. §    If there are multiple definitions
  244. §    Other ways of finding definitions
  245. «12   Browsing»
  246. §    The Browse command
  247. §    Finding classes in the Browser window
  248. §    Method and class popups
  249. §    Browsing classes without the browser
  250. §    Browsing methods without the browser
  251. «13   Documents and windows»
  252. §    New, Open, Close
  253. §    Save, Save As, Revert
  254. §    Close and Save Documents
  255. §    Autorevert
  256. §    Modify Read Only
  257. §    Saving window locations
  258. §    ... without being pestered
  259. §    Newly opened windows can be long or short
  260. §    <Option>–Zoom zooms just the length
  261. §    Number of windows at one time
  262. §    The Windows menu
  263. §    The display box
  264. §    Printing
  265. §    Illustrating your text
  266. «14   Editing»
  267. §    Introduction
  268. §    Undo
  269. §    Typing, Cut, Copy, Clear
  270. §    Paste preserves indentation
  271. §    Selection: front, next–to–front
  272. §    Paste Selection Behind
  273. §    Font, font size, tabs
  274. §    Shift Left / Right
  275. §    Reformat Selection
  276. §    Syntax coloring
  277. §    Graphic nesting display
  278. §    Arrow keys for moving around
  279. «15   Balance»
  280. §    Checks everything
  281. §    Shows the error location
  282. §    Balancing a file
  283. §    Balancing a specific delimiter
  284. §    Nested and bad comments
  285. §    Starting in the middle
  286. §    The asm problem
  287. «16   Search»
  288. §    Introduction
  289. §    Find is modeless
  290. §    Find options
  291. §    Batch Find options
  292. §    Dual Batch Find
  293. §    <Tab> and <Return>
  294. §    Find again
  295. §    Enter selection
  296. §    Recent finds are remembered
  297. §    Replace
  298. §    Replace and Find Again
  299. §    Replace All
  300. §    Multi–file searches
  301. §    Skip '-' : excluding files from a search
  302. §    THINK Find commands
  303. «17   “Go” commands»
  304. §    Go to Top/Bottom
  305. §    Go to
  306. §    Going to included files
  307. §    Going to text positions
  308. §    Going to markers
  309. §    Go Back
  310. «18   Markers and the Locations menu»
  311. §    Introduction
  312. §    Mark
  313. §    Marker menus
  314. §    Unmark
  315. §    Automark
  316. §    Copying marker names
  317. §    The Locations menu
  318. «19   Options, under the Edit menu»
  319. §    Introduction
  320. §    Number of lookup windows
  321. §    Number of entries per lookup window
  322. §    Remembering window locations
  323. §    Long or short windows
  324. §    Reformat Selection options
  325. §    Detect nested comment starts
  326. §    Ignore 'ckid's
  327. §    Automark source files, Save source/headers marks
  328. §    Relocate files automatically
  329. «20   Switching to other applications»
  330. §    Under the Finder (System 6)
  331. §    Under MultiFinder (or System 7)
  332. §    Check the disk for changes
  333. §    Working with THINK C
  334. «21   Show activities»
  335. §    Introduction
  336. §    What’s recorded
  337. §    Recording limitations
  338. §    Showing your recent activities
  339. §    What’s shown
  340. §    Temporary, obsolete, and undone activities
  341. §    Updated file names
  342. §    Reviewing activities
  343. §    Selective single undo
  344. §    Reverting a file
  345. §    Turning activity recording on and off
  346. «22  "Index" commands»
  347. §    Functions…
  348. §    Cross-Reference…
  349. §    #Includes…
  350. §    Marker Names…
  351. §    Potential Locals
  352. §    Standard Metrics
  353. §    Check Prototypes
  354. «23  Some thoughts on using EnterAct»
  355. §    Projects are cheap
  356. §    Learning from or reviewing code
  357. §    On documenting your work
  358. «24  If there's a problem»
  359. §    Out of memory
  360. §    Dictionary problems
  361. §    Lookup problems
  362. §    Editing problems
  363. §    Balance problems
  364. «25  License agreement, tech support»
  365. §    Technical support
  366. §    License
  367. «26  Appendix 1: Drag_on Modules»
  368. «27  Appendix 4: EnterAct as THINK's editor»
  369. §    Requirements
  370. §    Installing EnterAct as THINK’s editor
  371. §    Starting a session
  372. §    Working with EnterAct as THINK’s editor
  373. §    Using THINK’s Find commands from EnterAct
  374. «28  Appendix 5: EnterAct and Code Warrior»
  375. «29  Appendix 6: the Scripts menu»
  376.  
  377. (for all about the Drag_on Modules, please see
  378. «hAWK User’s Manual» and «Read Resource Manual»
  379. included with this package)
  380.  
  381. -    -    -    -    -    -    -    -    -    -    -    -
  382. Introduction
  383. -    -    -    -    -    -    -    -    -    -    -    -
  384. Feeling slightly disoriented? That’s just the anesthetic wearing off.
  385. You now have several megabytes of new memory installed in your head,
  386. preloaded with the important facts on everything of interest in your
  387. C source code. To access your new memory, click after the name of any
  388. function, struct, define, etc that you’d like to remember in detail,
  389. and glance at the "AutoLook" window.
  390.  
  391. Welcome to EnterAct. If you’re at light speed, prepare for warp drive.
  392. If you’re learning C, you’ll find that the ability to  look up anything
  393. of potential interest gives you more than total recall: you now have
  394. an on–line personal tutor.
  395.  
  396. If you just want to use EnterAct as a "definition viewer" to help
  397. out some other editor, see the section
  398. §    EnterAct as a "definition finder"
  399. (to get there, use "Enter Selection" and "Find Again" on the above line).
  400.  
  401. This manual is not as impersonal as it perhaps should be, for
  402. which the author apologizes, however insincerely. My name is Ken
  403. Earle, I’m responsible to you for EnterAct’s performance, and since
  404. several of EnterAct’s editing enhancements will be new to you I
  405. will occasionally intrude a personal opinion or bit of advice. For
  406. the most part, though, you should put on your Adventure hat and
  407. expect to take EnterAct in your own unique direction. If you’ve
  408. done some programming in C on the Mac, you’ll find that EnterAct
  409. is very easy to get used to. EnterAct is intended to complement
  410. MPW C, Symantec C/C++, and CodeWarrior C/C++, which you will
  411. need for compiling and testing your code. For creating,
  412. maintaining, learning from, and documenting code—read on.
  413.  
  414.  
  415.     60 second warmup
  416. EnterAct uses a project window to keep track of your files, as does
  417. THINK C for example. However, the main purpose of an EnterAct project
  418. is to allow you to build a dictionary of all terms in your project,
  419. for rapid lookup. There are three panes in an EnterAct project window,
  420. containing your .c, .h, and documentation files from left to right
  421. respectively. The easiest way to add files to your project is to use
  422. the “Add All In Folder...” command. To build a dictionary, select
  423. “Update Dictionary”. Unless there are major errors in your source code,
  424. this will zip along at 2-3 files per second. (If you hit a problem, see
  425. DON’T GIVE UP up above, around line 110 for easy fixes to most
  426. problems.) Double–click on any file name in the project window to
  427. view a file. To look up a term, double-click on it, or click just after
  428. it (or of course type it in) and press <Enter>. Select “AutoLook” to put
  429. EnterAct’s automatic definition retriever on-screen, and it will keep up
  430. with you as you edit and click about. You should find that "AutoLook"
  431. by itself can fill most of your information needs.
  432.  
  433.  
  434.     Onwards
  435. What next? If you read straight ahead to the end of the “Whirlwind
  436. tour” you’ll have a good grasp of the basics. Reading the remainder
  437. of the manual at some point is a good idea. You will find that many
  438. things that were relatively complicated or tedious before, such as
  439. information lookup, integrating documentation with code, file and
  440. window management, picking up where you left off, etc, are now much
  441. simpler, some to the point of being completely automatic. Inevitably,
  442. when tasks become simpler, new possibilities and approaches spring to
  443. mind.
  444.  
  445. You can use EnterAct as a replacement for THINK’s editor (THINK
  446. version 6 and later, the “use external editor” Edit option in
  447. THINK)—see Appendix 4 for the easy how-to. EnterAct also sends
  448. "touch" events to any running CodeWarrior compilation
  449. environment. 
  450.  
  451. After you feel comfortable with EnterAct, please take a look at the
  452. “hAWK User’s Manual” on disk. Many useful programs are supplied for
  453. this powerful little language, they’re easy to run, and hAWK does its
  454. work in the background.
  455.  
  456. And remember, take a break every hour!
  457.  
  458. -    -    -    -    -    -    -    -    -    -    -    -
  459. About EnterAct
  460. -    -    -    -    -    -    -    -    -    -    -    -
  461. §    When to use EnterAct
  462. EnterAct is a standalone, project-oriented, language-aware programmer’s
  463. editor designed to smooth the process of creating C and C++ code.
  464. You should find EnterAct useful for the following tasks:
  465.     •    requirements analysis, specification, and design document creation
  466.         or review
  467.     •    creating, maintaining and reviewing source code
  468.     •    as a "definition finder", helping editors that aren't as aware
  469.     •    linking support documents and source code
  470.     •    debugging sessions that require extensive source code review
  471.     •    keeping a log of your activities
  472.     •    oddjobs such as multi-file search and replace, automatic source code
  473.         generation, cross-referencing, algorithm prototyping, deleting or
  474.         copying a list of files, etc etc (via “Index” commands and hAWK,
  475.         both under the EnterAct menu).
  476.  
  477. You'll need a compiler for compiling and testing your
  478. code, and a resource editor will round out your code creation
  479. environment.
  480.  
  481. EnterAct can be used in place of THINK’s editor (the “use external
  482. editor” Edit option in THINK version 6/7). For the simple setup
  483. required, see Appendix 4.
  484.  
  485. To use EnterAct as a "definition finder" with other editors:
  486. •    read enough here to learn how to create a project, build
  487.     a dictionary, and show the "AutoLook" window. Knowing
  488.     how to call up "lookup" windows by pressing the <Enter>
  489.     key is also useful. 
  490. •    when you're using the other editor, also run an EnterAct
  491.     project with contents roughly corresponding to the code
  492.     you're working on - have the "AutoLook" window open,
  493.     as the frontmost text window in EnterAct. Your project
  494.     dictionary should be reasonably up to date.
  495. •    to look up a term with EnterAct; Copy it in the other editor,
  496.     and switch to EnterAct. If you don't immediately see the
  497.     definition in the AutoLook window (rare), press
  498.     <Command><Enter>. To look up the class or struct that
  499.     contains a particular member, press <Shift><Command><Enter>.
  500.  
  501. §    An overview
  502. EnterAct provides a variety of capabilities in several different areas
  503. to make creating and reviewing code simpler. As the following summary
  504. suggests, you do have a handful of new concepts to become comfortable
  505. with. But for the most part you’ll find just new ways of looking at
  506. old problems, and it shouldn’t be long before you take it all for
  507. granted.
  508.  
  509.  
  510.     Information management
  511.     •    each EnterAct project stores, for instant retrieval:
  512.         •    the prototype of every method and function (including static and
  513.             in-line)
  514.         •    and the full definition of every class, struct, union, enum, enum
  515.             constant, #define’d constant or macro, typedef, and variable
  516.         provided the definition or declaration occurs at the top level of
  517.         your project source code. As a special case, #define’s within struct,
  518.         union, and enum bodies are also recorded. (Hereafter, “definition” will
  519.         be used as shorthand for “definition or prototype”)
  520.     •    Definitions will be stored for any C/C++ file you
  521.         specify, including toolbox headers, standard C library files, class
  522.         source or headers, and of course your own source files, even if they
  523.         are under development (typically EnterAct can tolerate or compensate
  524.         for almost all first-draft errors and omissions)
  525.     •    the “AutoLook” window automatically displays the definition of any
  526.         name that you select or click after, keeping up with you as you edit
  527.         and mouse around. It also serves as a spelling checker
  528. •    for more permanent displays of definitions, or to look up a term when
  529.     you’ve forgotten its correct spelling, double-clicking on or clicking
  530.     after the name and pressing the <Enter> key creates a separate window
  531.     holding the definition. This is called "regular” lookup, and the
  532.     resulting window shows either all variant definitions, if your spelling
  533.     was exact, or closest matches, based on runs of matching characters,
  534.     if your spelling was off
  535. •    for phonetic or “sounds like” lookup, press <Option><Enter> instead
  536. •    for reverse or “struct for member” lookup, press <Shift><Enter> to
  537.     view all structs, classes, and unions whose definitions mention the
  538.     name
  539. •    results for regular, phonetic, and reverse lookup are shown in a
  540.     new separate “lookup” window, politely sized and placed. Hold down the
  541.     <Option> key and click in its title bar to select from a popup menu
  542.     listing the definitions that were retrieved for the name being looked
  543.     up
  544. •    as a result of the above approach, you can show several definitions
  545.     at once from the same file or different files in separate, self-managed
  546.     windows.
  547. •    EnterAct's "Browse" window does the expected things—and works
  548.     with first-draft C++ code.
  549.  
  550.     File and window management
  551.     •    an EnterAct project window has three panes, showing source, header,
  552.         and documentation file names in separate alphabetical columns. Any
  553.         file can be opened by double-clicking on its name
  554.     •    since Enteract is not a compiler, there is no need to set up code
  555.         segments. As a result, EnterAct’s “Add All In Folder” command can
  556.         add all of the files in a folder to your project with a single click
  557.         (including, optionally, all files in subfolders), automatically placing
  558.         source, header, and documentation files in their appropriate panes
  559.     •    all Mac headers, THINK C headers, or standard C headers can be added
  560.         to your project with single separate menu commands
  561.     •    multi-file selections (a generalization of multi-file searching)
  562.         can be made right in the project window
  563.     •    windows can remember their screen location and size—and, if you so
  564.         choose, won’t pester you about saving changes if all you changed was
  565.         the location or size
  566.     •    when EnterAct opens a file for the first time, it bases the width
  567.         of the window on the first 20 lines of the file
  568.     •    <Option>-zoom drops down the bottom of a window, not affecting the
  569.         width.
  570.     •    text files are saved safely. Project saving is automatic, and this
  571.         is threaded into the background when possible.
  572.  
  573.     Editing
  574.     •    smart paste of code blocks reduces the need to “Shift” left or right
  575.     •    the “Paste Selection Behind” command combines Copy, switch to the
  576.         window just behind, and Paste over what is selected there. It’s
  577.         undoable (in EnterAct even “Replace All” is undoable), and to help you
  578.         anticipate results the selection in your next-to-front window is
  579.         outlined in a box
  580.     •    “Balance” handles comments and strings, and can balance a whole file
  581.         at once. If there is an error, you will be shown where it is
  582.     •    now and then, a picture is worth a thousand words. For these
  583.         occasions, you can place and display a picture in any text document,
  584.         even a source file (put it inside a comment, and the compiler will
  585.         never know)
  586.  
  587.     Context restoration
  588.     •    “project context restoration”: when you close an EnterAct project,
  589.         it keeps a list of your project files that were open at the time; and
  590.         when you later reopen the project, your working documents will reopen
  591.         at the same time, placed on the screen where you left them (also called
  592.         the “painless Quit”) 
  593.     •    “activity review”: the “Show Activities” command displays a list
  594.         of the last 10,240 things you have done, in plain English, with full
  595.         contents of all text inserts and deletes. With this display, you can:
  596.         •    review your progress when making complicated changes
  597.         •    accurately bring your “Log” or “Version History” up to date if you
  598.             let this lapse for a bit
  599.         •    selectively undo a single activity
  600.         •    revert files to recover earlier versions
  601.     •    “safe switching”: EnterAct will optionally save your documents when
  602.         you switch out, and refresh them from disk when switching back if
  603.         you changed any with some other application. This restores the
  604.         synchronisation between EnterAct and other applications, and helps
  605.         prevent losing changes to a file.
  606.  
  607.     Context alteration ("navigation”)
  608.     •    “Automark”, mainly useful for marking all of the functions in a
  609.         source file at once, though it has other options. (To access a
  610.         document’s marker menu, hold down the <Option> or <Command> key
  611.         and click in the title bar of its window)
  612.     •    “Go to” accepts a file name followed by line number, or file name
  613.     followed by marker name, or any one of file name, line number, or
  614.     marker name. Useful for:
  615.         •    putting fixed links in your documents with file name followed by
  616.             line number (such as /* See App_Main.c 389 */ )
  617.         •    maintained links, consisting of file name followed by marker name
  618.             (such as /* See «MyApp Design Notes» «2.3 Custom Resources» */
  619.             To generate the text for a link of the form «file name» «marker
  620.             name», hold down the<Shift> and  either <Option> or <Command> keys
  621.             while clicking in the title bar of the window that has the mark; when
  622.             you select the mark from the resulting popup marker menu, the text
  623.             will be copied to your clipboard. Both file and marker name may be
  624.             abbreviated or slightly incorrect, eg
  625.             /* See «Design N» «Custom Rez» */
  626.         •    jumping to locations as reported in the “Show Activities” display
  627.         •    jumping to locations generated by hAWK programs
  628.             ($CompareFiles, $MFS_SuperLister, and many others)
  629.             and also locations generated by several of the "Index" commands,
  630.             such as "Cross-Reference..."
  631.     •    “Go Back” lets you toggle between two locations, in one or two files
  632.     •    jumping to a definition (<Option> double-click) works with toolbox
  633.         headers, first-draft code, and your own notes, almost always going
  634.         straight to the definition with no stumbling over a mention in a
  635.         comment, or a prototype. This allows you to use defined term names in
  636.         source or documentation as true “hyperlinks”.
  637.  
  638.     The best little language in the world
  639.     •    “hAWK” is a project-oriented version of “AWK”. AWK has long been
  640.         the C programmer’s little language of choice, and hAWK, with its
  641.         simple “three clicks and run” interface, is as easy to invoke as any
  642.         macro language
  643.     •    with one click, you can choose to have a program take its input from
  644.         the front text file in EnterAct, or all files selected for multi-file
  645.         operations in your EnterAct project
  646.     •    hAWK is a full programming language, modelled after C but simpler
  647.         in many ways, with many additional built-in capabilities (especially
  648.         for dealing with text)
  649.     •    use supplied hAWK programs to: generate a list of full path names
  650.         for all files in a project, list all occurrences of a word or string
  651.         or regular expression, copy or erase files, translate a C declaration
  652.         into English, list all potential local variables in a C function under
  653.         development, compare files, etc
  654.     •    and you can write your own programs to: check the contents of custom
  655.         resources or file data, prototype algorithms, and in general handle
  656.         any odd job having to do with text files that you can spell out an
  657.         algorithm for (using the fullest implementation of regular expressions
  658.         available anywhere)
  659.     •    as of version 3, you can write "magic clipboard" programs in hAWK
  660.         that will monitor EnterAct's clipboard, and, when conditions you
  661.         specify are met, will do anything you like to the clipboard's
  662.         contents. Useful for mowing down repetitive but moderately
  663.         complicated tasks (eg changing old-style C function declarations
  664.         to the new prototype style), or as a glossary expander etc. Once
  665.         your hAWK program is running, all you do is Copy and Paste. Typically
  666.         these programs flash the menu bar to indicate that the clipboard
  667.         has been altered.
  668.  
  669.     Using EnterAct as THINK’s editor
  670.     •    EnterAct works fine by itself, but if you have version 6 or
  671.     later of THINK C and sufficient memory you can use EnterAct as
  672.     a replacement for THINK’s own editor (this is the “use external
  673.     editor” option described in your THINK manual).
  674.     •    using EnterAct as THINK’s editor eliminates the need to
  675.     “Make” your THINK project when bringing it up to date, since
  676.     THINK C will automatically be made aware whenever you change
  677.     a source file with EnterAct—and all of EnterAct’s best features,
  678.     such as info display and hyperlinking, will be available within
  679.     THINK C. For the details, see Appendix 4.
  680.  
  681.     Using EnterAct as CodeWarrior's editor
  682.     •    Drop EnterAct into your main CodeWarrior folder. Things aren't
  683.     as automatic with CodeWarrior, so you'll have to start up your
  684.     CodeWarrior and EnterAct projects separately.
  685.     •    EnterAct sends "touch" events to any open CodeWarrior project,
  686.         so CodeWarrior will be able to keep track of which files need
  687.         recompiling.
  688.  
  689.     Using EnterAct as a "definition viewer" with other editors:
  690.     •    Have EnterAct with an appropriate project running while
  691.     you use the other editor. Your dictionary should be reasonable
  692.     up to date, and the AutoLook window open
  693.     •    Copy a term in the other editor, and switch to EnterAct
  694.     for instant definition display in the "AutoLook" window
  695.     •    If you don't see an instant definition, try
  696.     <Command><Enter> for spell-tolerant lookup of the clip
  697.     to a separate lookup window
  698.     •    To look up the struct or class containing a copied member
  699.     name, press <Shift><Command><Enter>
  700.     (When looking things up with the <Enter> key, <Command> is
  701.     for Clipboard, and <Shift> is for member lookup -- also called
  702.     "reverse" lookup, so remember "<Shift> into reverse"....)
  703.     
  704.     Miscellaneous affairs
  705.     •    EnterAct’s “Print” command can print illustrated documents, and
  706.         always folds back long lines rather than clipping them off
  707.     •    “Reformat Selection” lets you clean up plain text documentation,
  708.         including long comments. It was used to maintain this document
  709.     •    “Save As” can be used with projects, so you don’t have to start over
  710.         each time
  711. •    “Index” commands under the EnterAct menu: function call/called by
  712.     lists, cross-referencing, lists of markers or #included files, and
  713.     “Potential Locals”, which helps ease the declaration of local variables
  714.  
  715. §    Looking ahead
  716. It would be best at first to focus on building EnterAct projects and
  717. exploiting the various ways of looking up definitions and navigating
  718. around. For the necessary background, read straight ahead here to the
  719. end of the “Browsing” chapter. The one vital new skill to master is
  720. that of pushing the <Enter> key to view definitions, although the
  721. "AutoLook" window will almost always beat you to it.
  722.  
  723. After the “Browsing” chapter, topics become relatively independent.
  724. “Switching to other applications” is recommended reading, since as
  725. mentioned above EnterAct will save documents when you switch out and
  726. refresh them from disk when you switch back, and you should either
  727. agree with this approach or turn this option off. And before starting
  728. in on the “hAWK User’s Manual” on disk, it will help to be familiar
  729. with EnterAct’s approach to multi-file searching, as explained in the
  730. “Searching” chapter.
  731.  
  732. For help with any difficulties that might pop up, see the “If there’s
  733. a problem” chapter towards the end of this manual.
  734.  
  735. -    -    -    -    -    -    -    -    -    -    -    -
  736. Getting started
  737. -    -    -    -    -    -    -    -    -    -    -    -
  738.     Installation
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750. ...or...
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761. (that's an old picture, similarly for EnterAct 3)
  762.  
  763. You’ll find complete instructions for placing the bits and
  764. pieces that make up EnterAct on disk 1 in the file “Installing
  765. EnterAct 3/tt” (which starts up TeachText if
  766. you double-click it). As a minimum you should end up with
  767. EnterAct 3 and the “Drag_on Modules” folder in your compiler folder,
  768. as shown above for Symantec.
  769.  
  770. For CodeWarrior and MPW, the general rule is to place EnterAct and
  771. its Drag_on Modules within the same folder that contains the subfolder
  772. of Mac header files ("Mac #includes" etc) you wish to use. EnterAct
  773. will look within its containing folder for system headers when you
  774. pick the "Add Mac Headers", and distinguishes between system and
  775. user files in its Find dialog based on whether the file is within
  776. the same folder that holds EnterAct or is outside it.
  777. For CodeWarrior, drop EnterAct etc beside the actual compiler
  778. your are using, at the same level. For MPW, drop EnterAct etc
  779. beside your "Interfaces" folder.
  780.  
  781. To use EnterAct as THINK’s editor (version 6/7/8), please see Appendix 4.
  782.  
  783.     What to do first
  784. If you don’t feel comfortable using your Macintosh yet, please take
  785. an hour or so to play with some other program before continuing.
  786.  
  787. The Whirlwind tour will introduce you to the most important things.
  788. After a bit of pushing the <Enter> key and and playing with your new
  789. memory, you’re ready to start using EnterAct seriously—but it wouldn’t
  790. hurt to read the rest of the manual. 
  791.  
  792.  
  793.     Please read these
  794. If you’re a multi–platform developer, please read the section on
  795. “All–or–nothing macro’s” in the “Source code restrictions” chapter.
  796.  
  797. And you should know that EnterAct's default behaviour is to save all
  798. open documents when you switch out, as discussed in “Switching to
  799. other applications”, chapter 20. To avoid this, deselect the
  800. "Safe switching" option at the top of EnterAct's "Options..." dialog.
  801.  
  802.  
  803.     hAWK and Read Resource
  804. After becoming acquainted with EnterAct, add the “hAWK User’s Manual”
  805. and “Read Resource Manual” to an EnterAct project, open them up, and
  806. read along. Learning “Read Resource” takes 5 minutes. Learning to run
  807. a few hAWK programs takes an hour or so,  learning to write them isn’t
  808. that tough—and it’s fun! Adapting your application to call hAWK will
  809. take a day or two. Changing hAWK is harder, but all the source is there.
  810. "hAWK" is Mac interpreter for "AWK", which resembles C (though
  811. lacking C's more complicated features) with many built-in functions
  812. that let you dash off small programs to do nifty text manipulation.
  813.  
  814. -    -    -    -    -    -    -    -    -    -    -    -
  815. Definitions and conventions
  816. -    -    -    -    -    -    -    -    -    -    -    -
  817. (Note menu commands may appear in quotes here but often are
  818. just capitalized. They are sometimes used as verbs, as in
  819. “when you Balance a comment...”.)
  820.  
  821. Balance: checks all paired delimiters, and detects nested or
  822. improperly–formed comments. If you have an insertion point at the very
  823. beginning of the file, Balance will check the entire file. If there’s
  824. an imbalance, you’ll see where it is.
  825.  
  826. C code is shown in Courier 10.
  827.  
  828. Definition or Entry: for functions and methods, the prototype or
  829. equivalent. For everything else (struct, #define, variable, etc), the
  830. full statement in which the term was mentioned or defined.
  831.  
  832. Dictionary: the collection of terms and definitions for your project.
  833.  
  834. Drag_on Module: a “mini application” packaged as a separate CODE
  835. resource, called as a C function. For instructions and code to call
  836. Drag_on Modules from your application, see the “code to call Drag_ons”
  837. folder on disk 2, and also the example Drag_on caller “Minimal App7”.
  838. While Drag_on Modules require some application to act as a “shell”,
  839. support for all callback functions by the calling application is
  840. optional. Two modules are included: hAWK, a Mac version of AWK (see
  841. “hAWK User’s Manual”) and Read Resource (see “Read Resource Manual”).
  842. If you follow the “Getting started” instructions, both modules will
  843. appear at the bottom of EnterAct’s “EnterAct” menu.
  844.  
  845. Find Definition: given a selected dictionary term, opens the file where
  846. the term is defined and scrolls to the first instance of the term in
  847. the file. The equivalent of <Option>double–click, but in addition works
  848. with full method names, which contain colons.
  849.  
  850. “Go to” link, “Go to” selection: text typically of the form
  851.     file-name marker-name 
  852. where “file-name” is the name of an EnterAct project file and
  853. “marker-name” is the name of a marker in the file, with optional
  854. European-style quotes around either part
  855.     (for example, «MyProj.LOG» «To Do» ).
  856. To open the file and go to the marked position, select the
  857. file-name marker-name text and use the Go to command. Details are in
  858. “‘Go’ commands”, chapter 17.
  859.  
  860. Insertion point: the flashing “|” cursor which marks your place in a
  861. text window when no characters are selected. 
  862.  
  863. Look up a term: to look up a term, select an insertion point just to
  864. the right of it, or double-click on it, and press <Enter>. A lookup
  865. window will appear. The AutoLook window shows definitions automatically
  866. as you type or edit (double-click on the term or click to the right
  867. of it, or type it in).
  868.  
  869. Lookup window: a special kind of text window used to show dictionary
  870. entries. The title begins with “••” or “¶¶”. Often several entries are
  871. “stacked” in one lookup window; to cycle through them, press <Enter>
  872. with a range of characters selected -- or better, hold down the
  873. <Option> key and drag in the window's title bar to pick from a
  874. popup menu.
  875.  
  876. Menu commands are often quoted, always capitalized.
  877.  
  878. Paired delimiters:
  879.     ()         round brackets, or parentheses
  880.     []         square brackets
  881.     {}         braces, or curly braces
  882.     /* */     comment start and end, together a comment
  883.     " "         double quotes, around strings (continued across lines with “\”)
  884.     ' '         single quotes, or ticks.
  885.  
  886. Paste Selection Behind: will Copy the selection in the front window,
  887. switch to the next window, and Paste over what is selected there. The
  888. selection in the next–to–front window will be shown by a two–pixel wide
  889. black border.
  890.  
  891. Project: a three–pane window containing any group of source, header,
  892. plain text, and PICT documents. Selecting Update Dictionary builds a
  893. dictionary for all source and header files. Both the file list and the
  894. dictionary are kept on disk in the corresponding project file.
  895. Double–clicking on a file shown in the project window will both open
  896. the file and send the project window behind all other windows. It can
  897. be brought to the front again with the Windows menu, or
  898. <Command><zero>, if it’s hidden.
  899.  
  900. Range of characters selected: white text on a black background in the
  901. front window, seen for example when you drag over some text. In the
  902. next–to–front window, the selection range is shown outlined in a black
  903. box rather than white on black (the next– to–front window is affected
  904. by Paste Selection Behind, and by some Search commands when the Find
  905. dialog is in front).
  906.  
  907. Recent activity: a full specification of something you’ve done recently
  908. with EnterAct, as presented in the “••Recent Activities” window
  909. generated by the Show Activities command. All significant activities
  910. are recorded, including cut copy paste typing find replace new open
  911. close revert start quit. Recorded details include time, location, and
  912. contents if it was an insert or delete. For details see the “Show
  913. Activities” chapter.
  914.  
  915. Reformat Selection: evens out the line lengths in a range of selected
  916. text, with maximum line length and ragged right versus full
  917. justification as specified in the Options dialog. Intended for use with
  918. comments or plain text, rather than code.
  919.  
  920. Regular lookup: double-click on or click after a term, and press
  921. <Enter>. A lookup window appears, holding all definitions of the term,
  922. or closest matches based on spelling if your spelling was off.
  923. <Option>click in the title bar for a list of definitions.
  924.  
  925. Reverse lookup: select as for regular lookup, but press <Shift><Enter>.
  926. The resulting lookup window holds all struct, union, and class
  927. definitions which mention the word(s) being looked up. <Option>click
  928. in the window's title bar for a list of containing definitions.
  929.  
  930. Sounds-like lookup: select as for regular lookup, but press
  931. <Option><Enter>. Like regular lookup, but not case-sensitive, with
  932. closest matches based on sound rather than spelling. <Option>click in
  933. the resulting lookup window’s title bar for a list of definitions.
  934.  
  935. Specific single keys are placed in <>, eg <Enter>, <Option>, <Return>,
  936. <period>.
  937.  
  938. -    -    -    -    -    -    -    -    -    -    -    -
  939. Whirlwind tour
  940. -    -    -    -    -    -    -    -    -    -    -    -
  941.  
  942. Hum along
  943. This little tour displays EnterAct’s basic capabilities, to help you
  944. avoid that “lost in space” feeling. However, there is much of potential
  945. interest that is not covered here, so please at least browse through
  946. the rest of the manual afterwards.
  947.  
  948. For an example project we’ll be using “Minimal App7”, the files for
  949. which are included with EnterAct. If you feel adventurous,
  950. substitute your own project for Minimal App below.
  951.  
  952. To exactly follow the tour, you’ll need the files that make up “Minimal
  953. App7”, a minimal application that does nothing but call Drag_on
  954. Modules. The “Minimal App7 ƒ” folder contains the needed
  955. files. If you haven't moved it, it's still in your "EnterAct stuff"
  956. folder.
  957.  
  958.  
  959. Create a project
  960. We’ll be working with the files that make up “Minimal App7”, and the
  961. first step will be to create a project for it. The project will list
  962. source, header, and documentation files, and also hold a dictionary
  963. of all terms of interest.
  964.  
  965. Double–click on the EnterAct icon to start. You will see a dialog
  966. asking if you want to open an existing project—cancel it. Another
  967. dialog will appear, asking you to supply a name for a new project. Type
  968. in a name (such as “MinimApp7.e”), open the “Minimal App7 ƒ” folder,
  969. and click the Save button. A three–pane project window will appear.
  970. If you're already up and running (a good bet), pick "New Project"
  971. from the EnterAct menu and name away.
  972.  
  973.  
  974. Add some files
  975. You can add files to your project one at a time with the Add Files
  976. command—but try the Add All In Folder command instead: it works much
  977. the same as the Add Files command, but also allows you to select and
  978. add entire folders at once. However, files contained in subfolders are
  979. not added automatically -to do that, hold down the <Shift> key and
  980. pick the same menu item (now called "Add All in Subfolders...").
  981.  
  982. For our Minimal App project, select Add All In Folder, open the
  983. “Minimal App7 ƒ” folder, and double-click on either of the two files
  984. listed there (for example, “Call_Resource.c”). You will see both
  985. “Call_Resource.c” and “minimalApp7.c” appear in your project window,
  986. in the left (source or “.c”) pane.
  987.  
  988. There is no need to ever select one of the three window panes when
  989. adding files. The left pane is for your source files (.c), the middle
  990. for all header files (.h), and the right pane is for all other text
  991. files (and PICT’s). EnterAct selects the correct pane for each file
  992. automatically.
  993.  
  994.  For our project we’ll also want the toolbox headers and THINK C
  995.  headers. To add these to your project, hold down the <Shift> key and
  996.  select Add Mac Headers. All of the standard toolbox headers, and,
  997.  because of the <Shift> key, all THINK C headers, will be added to the
  998.  middle (header, or “.h”) pane of your project. If you don't have the
  999.  THINK C headers, just ignore any error message you might get.
  1000. At this stage, your project should look like this:
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.             source pane                    header pane                documentation pane
  1014.  
  1015. Use Add Front File to add this manual to your project, and you'll see
  1016. it appear in the rightmost (documentation) pane.
  1017.  
  1018. For illustration purposes the project window has been kept small, but
  1019. feel free to make it as large as you like. The project window will go
  1020. to the back when you double-click on a file name to open a file, and
  1021. it can be brought to the front from the Windows menu if it’s hidden.
  1022.  
  1023.  
  1024. Build a dictionary
  1025. (".c" and ".h" are used as shorthand for source and header below)
  1026. Your dictionary will contain all terms in your .c and .h files that
  1027. are defined or mentioned outside of a function, struct, or union body.
  1028. To build, it, select Update Dictionary from the Project menu, and sit
  1029. back for a few seconds—this shouldn’t take long, typically under 1/2
  1030. second per file on a Mac II. If a major problem or bug does interrupt the
  1031. dictionary build, you’ll see a message telling you what’s up. You can
  1032. either fix it and reselect Update Dictionary, or, with the
  1033. offending file selected in the project window, select Remove File
  1034. followed by Update Dictionary to go on with this tour immediately.
  1035. (See DON'T GIVE UP near line 110 above for fixes to common problems.)
  1036.  
  1037. If you are pursuing your own project instead of Minimal App7, you may
  1038. run out of memory when building your dictionary. If this happens,
  1039. either increase the amount of memory allocated to EnterAct by one Meg
  1040. and try again, or see “EnterAct Memory Needs” on disk 1 for a detailed
  1041. guide to estimating memory needs. Two megabytes can handle a good-sized
  1042. project, but a real whopper may need three.
  1043.  
  1044. Viewing definitions and prototypes
  1045. If you’re following along with the Minimal App example, open
  1046. “minimalApp7.c” by double-clicking on its name in the left pane of your
  1047. project window. To arrive at the right position for our example, select
  1048. Find from the Search menu, type in waitnextevent(  and then type
  1049. <Return> or click the OK button to see the following:
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061. Now is a good time to activate the AutoLook window: first free up some
  1062. room on your screen (a couple of inches at the bottom will do) and
  1063. then select AutoLook from the “EnterAct” menu. It explains itself. For
  1064. a quick look at a definition, either click just after a term or
  1065. double-click on it: the definition will appear instantly in the
  1066. AutoLook window.
  1067.  
  1068. As an AutoLook example, return to the “minimalApp7.c” window and
  1069. double-click on gEvtDetails, on the same line as WaitNextEvent(:
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091. You will see a definition of gEvtDetails appear immediately in the
  1092. AutoLook window. And, you also see a complete definition of
  1093. EventDetails. 
  1094.  
  1095. As you can see, the AutoLook window resolves variable, struct, and
  1096. typedef tangles to show you all the relevant definitions. It also
  1097. resolves #define’d “aliases” such as “#define H Handle”. For functions,
  1098. you’ll see a prototype, with function name and parameters preselected
  1099. so you can quickly paste a “template” for the function call into your
  1100. code (by switching to the AutoLook window and selecting the command
  1101. Paste Selection Behind). Basically, if the name is defined outside of
  1102. a function body, the AutoLook window will show you the essentials you
  1103. need to  use it. The only requirements are that a file containing a
  1104. definition (or prototype) for the name should be in your project, and
  1105. your dictonary should be up to date for that file.
  1106.  
  1107. As of version 3, EnterAct's AutoLook window will also display
  1108. definitions of local variables, and provide more useful lookup for
  1109. struct and class member names when you double-click on them or
  1110. click after them. For this to work, your file should be a source
  1111. (left pane) file, though not necessarily added to your project,
  1112. and you should use Automark to mark all the functions in your file.
  1113.  
  1114. By itself, the AutoLook window can supply most of the details you need
  1115. to program or review nonstop. However, the display in this window is
  1116. transient, keeping up with you as you click or double-click about, or
  1117. type for that matter. To produce a more permanent display of a
  1118. definition or prototype, more work is required on your part: you have
  1119. to press the <Enter> key. To see it work, double-click on EventDetails
  1120. in the AutoLook window, and then press the <Enter> key:
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151. Your screen may not look exactly like that, but you should see the
  1152. definition of EventDetails appear in a separate window, called a
  1153. “lookup” window.
  1154.  
  1155. A press of the <Enter> key produces a separate window containing the
  1156. information you’re after, definition or prototype.  As you’ll see
  1157. shortly, these separate “lookup” windows can take care of themselves.
  1158. And the “press <Enter>” style of lookup also works when your spelling
  1159. of a term is off, but still “distinctively close”.
  1160.  
  1161. In general, you can look up any function, method, struct class union
  1162. or enum tag, enum constant, typedef, or variable (including low–memory
  1163. and statics) that is defined or mentioned anywhere in your .c or .h
  1164. project files outside of a function, struct, or union body—and any
  1165. #define’d constant or macro that is defined outside of a function body.
  1166. In other words, just about everything of interest except local
  1167. variables or any other “thing” which is meant to be used only within
  1168. a single specific function. Note the AutoLook window does show local
  1169. variables and data members.
  1170.  
  1171. As you’ve seen, the fastest and easiest way to look up a definition
  1172. for a term is to double-click on it with the AutoLook window on-screen.
  1173. You can also click just after the term, or type it, and the AutoLook
  1174. window will keep up. It will also often show class member and
  1175. inline method definitions, after a slight delay.
  1176.  
  1177. However, the AutoLook window has three shortcomings:
  1178.     •    the display lasts only until you look up some other term
  1179.     •    your spelling of the term must be correct
  1180.     •    the display in the AutoLook window doesn’t update as you click about
  1181.         or edit in the AutoLook window itself.
  1182. To overcome these shortcomings, the “press <Enter>” style of lookup
  1183. produces a separate window holding one or more definitions of the term
  1184. being looked up. To look up a term in this way:
  1185.  
  1186.     •    double-click on it, or click just to the right of it, or type it in
  1187.     •    and press the <Enter> key.
  1188. A dictionary entry for the term will appear in a new small text window,
  1189. called a “lookup” window. Lookup windows are mostly like text windows,
  1190. the key differences being that they cannot be directly saved (Copy and
  1191. Paste to a real text window to do that), and they usually can show you
  1192. other dictionary entries. Only one is shown at a time. If your spelling
  1193. is off, the window will show best guesses rather than exact matches.
  1194. (To view other entries, <Option>click in the title bar.)
  1195.  
  1196.  
  1197. Lookup window frames
  1198. In the small display box along the bottom of the lookup window you will
  1199. see: the name of the file from which the entry was taken; the kind of
  1200. term it is (a one–letter abbreviation, for example “v” for variable,
  1201. “(” for a function, “s” for a struct); and two numbers—the current
  1202. entry you are viewing, followed by the total number of entries
  1203. currently stored in the lookup window. 
  1204.  
  1205. The title of the lookup window will be the term you wanted looked up,
  1206. preceded by two bullets, eg “••EventDetails”. The two bullets are a
  1207. sign that the window is a (temporary) lookup window, not a regular
  1208. document window.
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219. Viewing other entries in a lookup window
  1220. A lookup window may hold additional definitions if:
  1221.     •    there are variant definitions of the same term, such as defining
  1222.         and declaring instances of a global variable, or prototype and defining
  1223.         instance of a function
  1224.     •    the same term is used in different ways, such as a struct and a
  1225.         typedef with the same name
  1226.     •    your spelling of the term was incorrect: in this case, closest
  1227.         matches will be shown, and the number shown is under your control.
  1228. Numbers in the display box of the lookup window indicate which entry
  1229. you’re viewing, followed by the number of entries available: if the
  1230. numbers read “1/1”, then only one is present; whereas if the second
  1231. number is greater than one (from “1/2” up to “1/60”) then more entries
  1232. are “stacked up” in the window.
  1233.  
  1234. To view a different entry, hold down the <Option> key and
  1235. click-and-drag in the window’s title bar to select from a popup menu.
  1236. To produce a sample, type KeyDetails in any text window and press
  1237. <Enter> to produce a regular lookup window; this term doesn’t match
  1238. anything in the project, so closest matches are shown. From the
  1239. designation “1/4” in the display box, you can tell that four entries
  1240. are contained in the lookup window. To access them, hold down the
  1241. <Option> key, click in the title bar of the “••KeyDetails” lookup
  1242. window, and select from the resulting popup menu:
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260. You can use <Command> instead of <Option> to view popups if you prefer.
  1261. (Truncated full path names are also shown in the popup menu,
  1262. to help you pick the exact definition you want.)
  1263.  
  1264. Each entry in the popup begins with a one-character “hint” describing
  1265. the definition type, eg “t” for typedef, “v” for variable, “(” for
  1266. function. For a complete list, see “Hints with lookup” in the “Lookup”
  1267. chapter.
  1268.  
  1269. You can also cycle forwards through the entries in a popup window by
  1270. repeatedly pressing the <Enter> key. Press <Option><Enter> to cycle
  1271. backwards. Normally <Option>-clicking in the title bar is handier because
  1272. it gives you an overview of all the entries.
  1273.  
  1274.  
  1275. The <Enter> key
  1276. In any text window including lookup windows, pressing the <Enter> key
  1277. with an insertion point means “look it up”. The I–beam should be just
  1278. to the right of the term you want looked up. Pressing the <Enter> key
  1279. when characters are selected also activates regular lookup in a
  1280. non-lookup window, and in a lookup window the result of pressing
  1281. <Enter> is either regular lookup or cycling to the next match. In a
  1282. lookup window, if the selection agrees with the name of the term being
  1283. displayed or if your selection is so large that lookup cannot be done,
  1284. then <Enter> will cycle you to the next entry; conversely, if your
  1285. selection is not the name of the definition being shown and your
  1286. selection could be looked up (one word, or two words separated by
  1287. colons) then <Enter> will look up your selection.
  1288.  
  1289. Note that pressing the <Enter> key for separate lookup is meant
  1290. for use with names that are in your dictionary, and in particular
  1291. local variables are not included. To look up the struct or class
  1292. that contains a particular member, press <Shift><Enter> as
  1293. described below.
  1294.  
  1295. Whenever you display a new definition in a lookup window, a selection
  1296. in the window is made for you. Among other things, this selection
  1297. guarantees that if you press <Enter> or <Option><Enter> you will cycle
  1298. back and forth through the definitions, rather than looking something
  1299. up.
  1300.  
  1301. Basically, you don't have to remember anything here since it all comes
  1302. down to intention: if you intend to look up a name, selecting it and
  1303. pressing <Enter> will do just that. If you intend to cycle to the next
  1304. match, pressing <Enter> will do that instead. In the rare case that
  1305. you change the default selection in the window and then wish to cycle,
  1306. either pick from the popup menu or do a Select All before pressing
  1307. <Enter>.
  1308.  
  1309.  
  1310. Looking up something in a lookup window
  1311. Click to get an insertion point just to the right of the name you want
  1312. looked up, and press <Enter>. With any name except the name of the
  1313. definition currently being shown in the lookup window, you can also
  1314. double-click on the name and press <Enter>.
  1315.  
  1316.  
  1317. Keeping the lookup around
  1318. You can adjust the maximum number of lookup windows you wish to have
  1319. on–screen at one time, with the Options command: when this limit is
  1320. reached and you press <Enter> to see another lookup, one of the lookup
  1321. windows that is currently on–screen will quietly go away to make room
  1322. for the new one. To prevent this happening to a lookup window that
  1323. you’d like to keep around, select Keep Lookup Around from the windows
  1324. menu while the lookup window is in front. It will then stay on–screen
  1325. until you close it, or until you close the project. When you “keep
  1326. around” a lookup window, the two bullets “••” at the start of the
  1327. window title will change to “¶¶” to help you distinguish the keepers
  1328. from the ones that might go away later.
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340. If your spelling is off
  1341. If you press <Enter> for lookup and your spelling did not match any
  1342. term in your dictionary exactly, then you’ll see whatever entries come
  1343. closest, with suppression of variants on the same name in order to
  1344. maximize the variety shown. The entries will be presented in order from
  1345. best match to worst as you press <Enter>. EnterAct is very nearly as
  1346. good at judging what’s close as you are, even though it doesn’t
  1347. “understand” the terms being looked up. This perhaps surprising ability
  1348. results from the natural tendency to give distinctly different names
  1349. to terms with distinctly different meanings. You’ll find more about
  1350. this in the “Lookup” chapter, but EnterAct’s lookup power is sufficient
  1351. that one guideline is all you need: when you’re not sure of the correct
  1352. spelling, type your best guess, remembering that C is case–sensitive.
  1353. EnterAct will almost always retrieve what you want on the first try,
  1354. among the first three entries in the lookup window.
  1355.  
  1356. For an example with Minimal App, open up a new window, type
  1357. “KeyDetails” as a guess for “EventDetails”, and press the <Enter> key:
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368. Now press the <Enter> key twice more (or use the popup):
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396. Adjusting the number of lookup windows and entries shown
  1397. EnterAct comes preset with a maximum of four lookup windows on–screen
  1398. at one time, and a maximum of four entries per lookup window. You can
  1399. change these limits at any time by selecting the Options command under
  1400. the Edit menu. For complex problems, you may want more lookup windows.
  1401. If your recollection of the spelling of a term has gone out the window,
  1402. you may want to temporarily increase the number of alternate entries
  1403. returned per lookup window. You can vary the number of lookup windows
  1404. from 1 to 10, and the number of entries per window from 1 to 20.
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426. Working with lookup windows
  1427. You’ll probably find that the AutoLook window by itself can handle more
  1428. than half of your information retrieval needs. And often you’ll want
  1429. to have more permanent separate lookup windows showing data structures
  1430. that you’re working with for more than a moment, and transient lookup
  1431. windows to supplement the AutoLook display. Separate lookup windows
  1432. are generated by double-clicking on or clicking after a name and
  1433. pressing the <Enter> key, and made permanent by selecting Keep Lookup
  1434. Around (the key equivalent <Command><K> is a good one to memorize).
  1435.  
  1436. To help you manage lookup windows EnterAct places, sizes, scrolls, and
  1437. makes selections in them for you, and also closes old lookup windows
  1438. to make room for new ones. But the lookup windows have to go somewhere
  1439. on your screen(s), and you’ll find the lookup process goes more
  1440. smoothly if you leave some screen area free for the lookup windows to
  1441. occupy. How much room you leave for lookup windows is best judged by
  1442. experience, and will vary according to the needs of the moment. Some
  1443. things to keep in mind:
  1444.  
  1445.     •    lookup windows ignore the project window when looking for a place
  1446.         to appear
  1447.     •    lookup windows prefer to occupy a small place rather than cover one
  1448.         of your working windows
  1449.     •    if some window has to be covered by a lookup window, the lookup
  1450.         window will try to avoid your front two windows
  1451.     •    lookup windows will try to appear right next to your front window,
  1452.         preferably below or above it.
  1453.  
  1454. Reverse lookup (<Shift><Enter>)
  1455. On occasion you may find yourself viewing a member name and wondering
  1456. what struct, union, or typedef contains it. Quite often, the AutoLook window
  1457. will immediately display the definition you want. If not, double-click
  1458. on or click after the member name and press <Shift><Enter> to invoke
  1459. EnterAct's "reverse lookup".
  1460.  
  1461. Here’s the result of double-clicking on ParamBlockHeader and pressing
  1462. <Shift><Enter>:
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483. (Note pressing just <Enter> would have produced the definition
  1484. of ParamBlockHeader, not a list of structs or classes that
  1485. contain it)
  1486.  
  1487. As with all lookup windows, you can access the other definitions
  1488. stacked up in it by holding down the <Option> key and clicking in the
  1489. title bar to choose from a popup menu. 
  1490.  
  1491. Reverse lookup is not case-sensitive. Although it is called “struct
  1492. for member”  lookup elsewhere, it is actually slightly more, since it
  1493. attempts to match your selection with something in a struct, union,
  1494. or typedef without regard for whether it is a member name. Reverse
  1495. lookup accepts arbitrary strings of text up to 255 characters (for this
  1496. you’ll have to select the text to be looked up and then press
  1497. <Shift><Enter>) and will match it against anything in a definition,
  1498. even inside a comment. Aside from being case-insensitive, reverse
  1499. lookup requires exact spelling—but your selection can be just part of
  1500. a word, or several words with punctuation included.
  1501.  
  1502. The AutoLook window will usually show struct-for-member
  1503. lookup for a term. If you're inside a function in a source file then
  1504. AutoLook will be on average more accurate at providing the correct
  1505. definition. In any case, only the first containing struct or class will be
  1506. shown. This lets you see prototypes for inline method definitions that are
  1507. entirely contained in a class definition, and "fDataMembers", as
  1508. well as regular struct definitions for some member.
  1509.  
  1510.  
  1511.  ”Sounds like” (phonetic) lookup
  1512. The situation: “I’m desperate, show me a definition even if it’s wrong,
  1513. all I can tell you is the name sounded something like this:”. The
  1514. answer: type your guess and press <Option><Enter>. Your guess will be
  1515. boiled down to a string of standard consonants, then compared with
  1516. boiled-down versions of all your dictionary terms, and you’ll be shown
  1517. the best matches. <Option><Enter> is not case-sensitive (it's only
  1518. barely vowel-sensitive), and should be kept in mind as an
  1519. emergency backup, for those rare occasions when regular lookup gives
  1520. up on you.
  1521.  
  1522. Seeing where a term is defined
  1523. To jump to the definition of a term, select the entire term, and choose
  1524. Find Definition. This will open the file where the term is defined,
  1525. and will usually show you the defining instance of the term.
  1526. <Option>double–clicking on a term does the same thing with single-word
  1527. terms, but doesn’t work with full method names, which consist of two
  1528. words separated by colons. For those, you will need to use Find
  1529. Definition. For more on this, see the “Browsing” chapter.
  1530.  
  1531. As a Minimal App example, open a new window if you haven’t done so,
  1532. type gacc , and <Option> double-click on it:
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544. You’re viewing the definition of the static variable gacc , which is
  1545. used for communicating with Drag_on Modules. You will also be able to
  1546. jump to the definitions of static functions, #define’s, struct, union,
  1547. enum, and class tags, enum constants, typedef’s, methods—in other
  1548. words, anything defined at the top level in your source files.
  1549.  
  1550. If you can’t jump to a definition because your spelling is wrong, just
  1551. look up the correct spelling first by clicking after the name and
  1552. pressing the <Enter> key. Then, you can <Option> double-click on the
  1553. correctly-spelled name right in the lookup window.
  1554.  
  1555. For the special case of multiple definitions of a term (eg several static
  1556. variables with the same name), you need to tell EnterAct which one you
  1557. want, and the way to do that is to do the <Option>double-click in a
  1558. lookup window that is displaying the exact definition you want. So
  1559. the sequence is:
  1560. •    look the name up (select it, press <Enter>)
  1561. •    use the lookup window's popup menu to find the exact definition
  1562.     you want (<Option>click in the window's title bar, and look at the
  1563.     truncated full path names shown beside each instance)
  1564. •    after picking the one you want from the popup menu, double-click
  1565.     on the term and off you go.
  1566.  
  1567. Balance
  1568. Balance checks all of the paired delimiters in C (with the picky
  1569. exception of angle brackets <>). If you select an insertion point at
  1570. the top of a file (with <Option><up arrow>, or Go to Top), Balance will
  1571. balance your entire file. If any error in balance is detected, you’ll
  1572. be shown the mismatched or unmatched delimiter. When balancing a file,
  1573. if you hear a beep and the insertion point remains at the top of the
  1574. file, that means your whole file balanced.
  1575.  
  1576. As a shortcut, you can just double-click on a delimiter.
  1577.  
  1578. Balance also detects nested comments, and more importantly any single
  1579. failure to properly start or end a comment, something even most
  1580. compilers don’t do. Since EnterAct’s dictionary–builder checks comments
  1581. fully, simply by building the dictionary you will guarantee that no
  1582. improper comment in any of the included source files will ever generate
  1583. a wild pointer or an uninitialized variable.
  1584.  
  1585. If your source code deliberately contains nested comment starts, select
  1586. the Options command and uncheck the “Detect nested comment starts” box.
  1587.  
  1588. Searching
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601. The Find dialog in EnterAct is modeless, which means that when the Find
  1602. dialog is in front any search command you pick will apply to the window
  1603. just behind it. An important exception is Replace All, which works only
  1604. when a text window is in front. 
  1605.  
  1606. The "Find" button in the dialog is the exact equivalent of the
  1607. "Find Again" menu command. Both can be used with the project
  1608. window itself by the way, to find file names in long lists.
  1609.  
  1610. A popup menu at the top of the Find dialog remembers the 20 most recent
  1611. strings of characters that you have searched for.
  1612.  
  1613. The little buttons in the lower–right of the Find dialog allow to to
  1614. set up a “coarse” multi–file search of your project files. As you click
  1615. them, you’ll see bullets appear beside files to be searched in your
  1616. project window. 
  1617.  
  1618. If you click the "Batch" check box, your multi-file search will be
  1619. done all at once, and the results presented in a text window
  1620. (file name, line number, and the full line where found). To go to
  1621. a particular found instance, click on the line and use "Go to...".
  1622.  
  1623. To “fine–tune” your multi–file selection, hold down the <Option> key
  1624. and click on or drag over the file names right in the project window.
  1625. Try it out now by clicking and dragging in your project window with
  1626. the <Option> key down and you’ll see that it acts as a toggle,
  1627. selecting files if they were not selected and vice versa. Your
  1628. multi-file selection can also be used with the Remove •'d Files
  1629. command, and as input to a hAWK program (which makes setting up a
  1630. program run a trivial thing).
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647. Adding marks to a source file
  1648. Markers can be used for a variety of purposes, but in practice most
  1649. people are quite satisfied if they can mark all of the function
  1650. definitions in a source file. EnterAct’s Automark command has a
  1651. considerable range of options for marking a variety of names in your
  1652. source files, but the default options selected in the Automark dialog
  1653. are to clear all existing markers and then mark all function
  1654. definitions. You’ll probably find that this is all you ever want to
  1655. mark in a source file.
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670. To clear all existing marks from a source file, and automatically mark
  1671. all function definitions in the file:
  1672.     •    bring the file in question to the front
  1673.     •    select the Automark command (under the Search menu), and hit
  1674.         <Return> or click the “Mark ’em” button
  1675.     •    use Save if you wish to preserve the marks.
  1676. Note that the file in question does not have to be in your current
  1677. project, nor do you need to have a project open at the time. And
  1678. marking and saving a document does not change the (finder) modification
  1679. date if the contents of the document are unchanged, so no spurious
  1680. updates will be done by either EnterAct or THINK C.
  1681.  
  1682. To access the popup menu listing marks for a file, hold down the
  1683. <Option> or <Command> key and click-and-drag in the title bar of the
  1684. file’s window. Just select a mark and off you go.
  1685.  
  1686. EnterAct’s markers are compatible with THINK C and MPW, indeed the
  1687. suspicion is that there is only one kind of marker in the universe.
  1688.  
  1689. Now would be a good time to try out the Automark command, preferably
  1690. on one of your own source files that has never had any marks before
  1691. (but feel free to try it on one of the two Minimal App source files).
  1692. The key-equivalent for Automark, <Command><2>, is worth memorizing.
  1693. Marking a file usually takes less than half a second. If you mark the
  1694. functions in your source files, AutoLook will be able to look up local
  1695. variables and also provide the right struct or class definition
  1696. corresponding to a member more often.
  1697.  
  1698. Markers can also be added “manually’” to a document, most commonly to
  1699. mark section or chapter headings in your documentation. For an example,
  1700. see the online version of this manual, or the “hAWK User’s Manual”
  1701. supplied on disk 2. For the details on markers, please see the “Markers
  1702. and Automark” section of the “Search” chapter.
  1703.  
  1704. Going to markers in other files
  1705. As an aid to linking source files with supporting documentation,
  1706. EnterAct gives you a way to jump to a marker in any project file. This
  1707. is done by selecting text in any window that consists of a project file
  1708. name followed by a marker name, and then issuing the Go to command.
  1709.  
  1710. EnterAct can generate the necessary file name and marker name for the
  1711. link, as follows:
  1712.     •    in the window for the document in whch the marker is defined, access
  1713.         the marker menu and pick the mark, but in addition to holding down the
  1714.         <Option> or <Command> key hold down the <Shift> key as well
  1715.     •    the necessary text will be placed on the clipboard, ready for
  1716.         pasting. The file name and marker name will each be surrounded by «»
  1717.         quotes, which are optional but help the text to stand out.
  1718.     •    to generate the text for all markers in one or more files, you
  1719.         can use the "Index Marker Names..." command (chapter 22).
  1720. A typical “Go to” link looks like
  1721.     /* See «My File Notes» «Variations on FSSpec» */
  1722. and if the file “My File Notes” has been added to your current project
  1723. then you can jump to the marker named “Variations on FSSpec” by
  1724. selecting all of the file name and marker name including the
  1725. surrounding «» quotes, and then using the Go to command.
  1726.  
  1727. The advantage of this kind of link is that since the marker position
  1728. is maintained as you edit, so is your link. With this
  1729. «file name»«marker name» style of link, both file and marker name can be
  1730. abbreviated, and the link is immune to minor variations in spelling.
  1731.  
  1732. Many variations on “Go to” are available, such as going to a file-name
  1733. line-number, or just a file name, marker name, or line number. For
  1734. details, see the “‘Go’ commands” chapter.
  1735.  
  1736.  
  1737. Keeping track of things
  1738. When you close a project, it remembers which project text files you
  1739. have open. Later, when you reopen the project, those text files are
  1740. reopened as well. This makes it a little easier to pick up where you
  1741. left off. You could call this “context restoration”, though some like
  1742. to call it the “painless Quit”. It’s all automatic—just close the
  1743. project before you close your working files, or if you’re quitting,
  1744. don’t bother to close your working files first.
  1745.  
  1746. The concept of “undo” takes a step forward with EnterAct’s Show
  1747. Activities command, which displays the last 10,240 things you have done
  1748. with EnterAct. Descriptions are in plain English, and full contents
  1749. of edits are shown. A typical entry looks like this:
  1750.  
  1751. ¶45
  1752. Tue, Mar 9, 1993 7:45:11 pm TYPING «Untitled-1» 1 1 (obs)
  1753. =>inserted 15 characters:
  1754. «AdjustTheCursor»
  1755. ¬
  1756.  
  1757. —where “«Untitled-1» 1 1 (obs)” means the action started in the
  1758. “Untitled-1” window at line 1, character 1 on the line (ie the start
  1759. of the file), and the typing is now “obsolete”, ie it was never saved
  1760. to disk before closing the window. The “file name - line number” part
  1761. of the activity record is compatible with EnterAct’s Go to command.
  1762. And the full contents of all inserts and deletes are shown, up to a
  1763. very large limit. By using "Go to" and the contents of the activity
  1764. record you will be able to locate and selectively undo any of your
  1765. recent activities, provided that you haven’t destroyed the context of
  1766. the edit with a huge delete or by erasing the corresponding file. To
  1767. help you locate the edit position, Show  Activities provides the option
  1768. of correcting the original positions of edits to reflect the effects
  1769. of other edits, which is normally what you’ll want when reviewing or
  1770. selectively undoing your recent activities.
  1771.  
  1772. Since there are new concepts here, the “Show Activities” chapter goes
  1773. into considerable detail on such topics as “obsolete edits” and
  1774. “updated activity positions”. Once you’ve read through it, you’ll
  1775. realize you knew most of it already—you just didn’t talk about it much
  1776.  
  1777. EnterAct saves your activities to a disk log as you work. So “undo”
  1778. capabilities are not lost just because you quit and restart.
  1779.  
  1780. There is a way to undo files (one at a time) back to specific
  1781. activities. This involves the use of a hAWK program, and you’ll find
  1782. the details in the “Show Activities” chapter.
  1783.  
  1784. Though you haven’t done much yet, it wouldn’t be a bad idea to call
  1785. up the Show Activities dialog, pick any old options, click the OK
  1786. button, and see what happens. Not something you’ll use every day, but
  1787. your last ten thousand activities are still there if you need to review
  1788. or undo them.
  1789.  
  1790.  
  1791. Classes and methods
  1792. When you build yourself a project that contains classes, try out the
  1793. Browse command to see a graphic view of your classes. Double–click on
  1794. a class name to view the class definition, click–and–hold briefly on
  1795. a class name to select from a list of methods, and then view the method
  1796. definition. If you’re new to C++ and all that, you’ll find no better
  1797. way to learn than by exploiting EnterAct’s project–building, lookup,
  1798. and browsing power—in fact, you might want to build a project for THINK
  1799. C’s ArtClass demo or somesuch right now.
  1800. Incidentally, here’s a shortcut to adding all of the source and header
  1801. files in a folder that contains nothing but other folders:
  1802. •first add a dummy text file (call it “_junk” or somesuch) at the top
  1803. level of the folder containing the source and header folders;
  1804. •then hold down the <Shift> or <Option> key while selecting the
  1805. Add All In Folder command; double–click on your “_junk” file and all
  1806. files in all subfolders will be added to your project.
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843. Little things worth knowing
  1844. If you hold down the <Option> key while clicking in the zoom box of
  1845. a window, only the length will be zoomed.
  1846.  
  1847. When you double–click on a file in the project window to open the file,
  1848. the project window will retreat behind all other windows. You can bring
  1849. it to the front with <Command><zero>. Even on small screens this allows
  1850. you to have a large project window and use it conveniently as a “mini
  1851. Finder”.
  1852.  
  1853. Paste preserves relative indentation, at least in the commonest
  1854. situations where you would want your indentation to be retained( see
  1855. the “Paste preserves indentation” section in the “Editing” chapter).
  1856.  
  1857. Windows remember their last saved location, unless you select otherwise
  1858. from the Options dialog. 
  1859.  
  1860. EnterAct can take special care of your text documents, ensuring
  1861. that disk files are updated when you leave EnterAct, and windows
  1862. are updated when you return to EnterAct (see “Switching to other
  1863. applications”).
  1864.  
  1865. Reformat Selection is handy for making comments pretty again after
  1866. you’ve chopped them up (it’s undoable, and some options are available
  1867. in the Options dialog). 
  1868.  
  1869. There are some other things worth trying out, but you’ll find them
  1870. easily as you browse through the rest of this manual. 
  1871.  
  1872.  
  1873. Source code restrictions (don't panic)
  1874. There are three sorts of code constructions that are nominally correct,
  1875. but throw off EnterAct’s dictionary–builder. Please read the next
  1876. chapter "Source code restrictons" if the very notion bothers you.
  1877. Or just go ahead and use EnterAct, but remember that if you do
  1878. run into a problem while building your dictionary there are simple
  1879. workarounds for all problems in the "Source code restrictons" chapter.
  1880.  
  1881.  
  1882. Onwards
  1883. If you’ve tried things out for yourself while taking this tour, I
  1884. expect you know enough about EnterAct to begin using it full–time for
  1885. code creation and review—aside from knowing when to poke the <Enter>
  1886. and <Option> keys, there isn’t much to the basics. Eventually, alas,
  1887. you should probably read the rest of the manual. Personally, I enjoy
  1888. reading manuals.
  1889.  
  1890. To acquaint yourself with hAWK and Read Resource, add the on–disk “hAWK
  1891. User’s Manual” and “Read Resource Manual” to an EnterAct project and
  1892. follow the instructions therein. Learning Read Resource is a 5 minute
  1893. job. hAWK is rather more complicated, but it’s a powerful, widely–used
  1894. little language and learning it should prove well worth the effort.
  1895. Running hAWK programs is easy, at least, and many useful programs are
  1896. included.
  1897.  
  1898.  
  1899. -    -    -    -    -    -    -    -    -    -    -    -
  1900. Source code restrictions (ayeee! I knew it!!) - don't panic
  1901. -    -    -    -    -    -    -    -    -    -    -    -
  1902. §    Why not just C/C++?
  1903. EnterAct is able to identify terms in your code and correctly deduce
  1904. the type and definition of each term without doing extensive
  1905. preprocessing or semantic analysis. The benefits are lightning speed,
  1906. considerable tolerance of first–draft errors, and full information
  1907. retrieval, definition finding, browsing, and automatic marker placement
  1908. available right from the beginning of the code creation process. This
  1909. is all made possible with EnterAct’s Heuristic Adaptive Reentrant
  1910. Parser, which is based on a description of the way people actually
  1911. write code and the importance they attach to various constructs,
  1912. rather than on the textbook prescription. The drawback is that EnterAct
  1913. cannot deal with absolutely everything that is possible in C/C++, and
  1914. some minor restrictions must be satisfied in order for the
  1915. dictionary–builder to deal properly with your code.
  1916.  
  1917. In practice, only the “illegal aliases” will present a significant
  1918. problem if present, in that the only workaround is to remove them
  1919. (have you ever seen one? me neither...).
  1920. Obviously-unnecessary parentheses will result in extra or missing
  1921. dictionary entries for some terms. Troubles with aliases and
  1922. parentheses are extremely rare, since they obfuscate the source code
  1923. for beginner and expert alike. To overcome problems with nested comment
  1924. starts or “all-or-nothing macro’s”, you just need to make EnterAct
  1925. aware that they are present, as explained below.
  1926.  
  1927.  
  1928. §    Aliases
  1929. Defined equivalents for certain keywords and punctuation should be
  1930. avoided. A defined equivalent or alias takes the form
  1931.     #define    Record     struct
  1932. for example. EnterAct won’t know that “Record” is supposed to mean
  1933. “struct”, and the dictionary–builder won’t work well at all.
  1934.  
  1935. Keywords that should not be aliased:
  1936.     asm        enum        pascal        Pascal        struct        typedef    
  1937.     union        void        class
  1938. Punctuation that should not be aliased:
  1939.     ;    :    ,    \    "    '    {}    ()    []    /    *    =
  1940.     
  1941. You will never see aliases for any of these in published code, or in
  1942. any code intended to be read by more than one person, for the simple
  1943. reason that such a creature as
  1944.     Record fileData BEGIN int x SEMI END SEMI
  1945. would be rather difficult for anyone but the author to read.
  1946. Other aliases, such as
  1947.     #define    EQ    ==
  1948. are perfectly OK, by the way.
  1949.  
  1950. §    Obviously unnecessary parentheses
  1951. These are just as rare as the aliases above. This restriction applies
  1952. only outside of function bodies and refers only to parentheses that
  1953. would result in a variable declaration resembling a function
  1954. declaration. An example would be
  1955.     Peter    (Harvey);
  1956. Right now you know as much as EnterAct does when it runs into this sort
  1957. of thing—is it a variable declaration or a function declaration? You
  1958. may have deduced that the above declaration is almost certainly for
  1959. a function “Peter” returning an (implicit) int, since you would never
  1960. type those parentheses in a simple variable declaration,
  1961.     int    (x);
  1962. —these are an example of what is meant by “obviously unnecessary
  1963. parentheses”, namely parentheses that make the code harder to read,
  1964. not easier. If you avoid these excessive parentheses when declaring
  1965. variables outside of a function, that’s all that’s needed. Once again,
  1966. you won’t see them in any published code, and even beginners feel that
  1967. such parentheses make life harder, not easier.
  1968.  
  1969.  
  1970. §    Nested comment starts
  1971. This refers to two consecutive comment starts with no intervening
  1972. comment end, eg
  1973.     /*#define    DEBUG    /* some comment here */
  1974. where the intent is to define or undefine DEBUG by removing or
  1975. replacing the first comment start. If your code employs this (lazy)
  1976. sort of construct, then instruct EnterAct that this is not an error
  1977. by selecting Options… from the Edit menu and removing the check mark
  1978. from the box titled “Detect nested comment starts”. There is an
  1979. illustration of this in the “Options” chapter, by the way. As a
  1980. side-effect, EnterAct will not be able to warn you if a comment end
  1981. has accidentally been omitted.
  1982.  
  1983. If you value the notion that EnterAct can fully trap any single failure
  1984. to properly start or end a comment (something that many compilers,
  1985. including THINK C, don’t do), then leave the check mark in the  “Detect
  1986. nested comment starts” box, and remove the nested comment starts from
  1987. your code. Simplest, use "//" style comments instead.
  1988.  
  1989. §    Preprocessor tangles
  1990. Although these do pop up, they're easy to fix up. 
  1991.  
  1992. Conditional #defines which duplicate important punctuation can
  1993. cause trouble, such as
  1994.     #ifdef GO_LONG
  1995.     long GetArrayIndex(void) {
  1996.     #else
  1997.     short GetArrayIndex(void) {
  1998.     #endif
  1999. —EnterAct will complain about the '{' being there twice, and
  2000. the simple fix is to put the curly brace (which isn't conditional
  2001. anyway) after the conditional part:
  2002.     #ifdef GO_LONG
  2003.     long GetArrayIndex(void)
  2004.     #else
  2005.     short GetArrayIndex(void)
  2006.     #endif
  2007.     {
  2008.  
  2009. EnterAct's parser can sometimes spazz out because it's trying to
  2010. handle C and C++ and first-draft code and all possible values of
  2011. a #define all at once. For example,
  2012.     typedef struct A
  2013.     #ifdef __cplusplus
  2014.     : public B
  2015.     #endif
  2016.     {
  2017. used to generate a complaint, and there may still be similar constructs
  2018. out there that cause a problem. The fix is to provide the full C and
  2019. C++ introductions separately, as in
  2020.     #ifdef __cplusplus
  2021.     struct A : public B
  2022.     #else
  2023.     typedef struct A
  2024.     {
  2025.  
  2026. And one more tangle: if you put something that's deliberately
  2027. uncompilable in your code, avoid all punctuation except commas
  2028. and semicolons (some few others might work). For example,
  2029.     #ifdef A_Compiler
  2030.     #ifdef B_Compiler
  2031.     error - won't you please make up your mind?!
  2032.     ...
  2033. would trip EnterAct, whereas
  2034.     #ifdef A_Compiler
  2035.     #ifdef B_Compiler
  2036.     error, please make up your mind
  2037. while lacking punch, would work fine from EnterAct's view.
  2038.  
  2039. §    All–or–nothing macro’s
  2040. This final restriction is one that you may run into, but the workaround
  2041. is easy.
  2042.  
  2043. An “all–or–nothing” macro is a macro that looks something like
  2044.     #ifdef        BLUETREECOMPILER
  2045.     #define P(x)     x
  2046.     #else    /* some other compiler */
  2047.     #define P(x)
  2048.     #endif
  2049. —so P(x) either does nothing at all to its argument or it “eats” the
  2050. argument, but either way the macro itself disappears from the code.
  2051. If such a macro is the very first thing in a statement then EnterAct
  2052. will deal with it correctly, for example
  2053.  
  2054.     P(typedef  int  INT16;)
  2055. would result in INT16 being recorded as a typedef’d equivalent of
  2056. “int”. 
  2057.  
  2058. However, if the all–or–nothing macro is not the very first thing in
  2059. the statement, as in
  2060.     int myFunc P((int x, long y));
  2061. then EnterAct will mistakenly record “P” and not “myFunc” as the
  2062. function name, and in general it will misrecord any similar statement
  2063. where an–or–nothing–macro isn’t the first thing in the statement.
  2064.  
  2065. In case you’re wondering, the intention of
  2066.     int myFunc P((int x, long y));
  2067. is to produce either
  2068.     int myFunc (int x, long y);
  2069. or
  2070.     int myFunc ();
  2071. —in other words either a proper modern prototype or an old–fashioned
  2072. declaration, and this sort of thing is useful when writing code that
  2073. will be compiled using different compilers.
  2074.  
  2075. What to do? Call up the Macro's to skip dialog from the EnterAct menu,
  2076. and enter the name of the macro there.
  2077.  
  2078. (PLEASE NOTE you may not realize you have an all-or-nothing macro until
  2079. after you have built your dictionary. If this is the case, you should
  2080. completely rebuild your dictionary to ensure that all definitions are
  2081. correct. To completely rebuild your dictionary:
  2082. •    hold down all three of the <Shift>, <Option>, and <Command> keys
  2083.     while using the mouse to select Update Dictionary from the EnterAct
  2084.     menu.
  2085. )
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108. (This button reads “New projects” if no project is open at the time.)
  2109.  
  2110. -    -    -    -    -    -    -    -    -    -    -    -
  2111. Projects
  2112. -    -    -    -    -    -    -    -    -    -    -    -
  2113. §    Introduction
  2114. Any collection of TEXT or PICT files from up to 6 disks can be added
  2115. to an EnterAct project. The project window displays three lists of
  2116. files in your project, and behind the scenes your project contains a
  2117. dictionary of C/C++ term definitions, prototypes, and general notes. To
  2118. create and make use of a project:
  2119.     •    use New Project to create an entirely new project, or use Save As
  2120.         with a project window in front to build on an existing project
  2121.     •    if you have nonstandard file extensions (beyond the usual
  2122.         .c, .h, .cp etc) use the "File Extensions..." dialog to make your
  2123.         project aware of them
  2124.     •    add files to your project with Add Files (one at a time) or Add All
  2125.         In Folder (all files in the folder at once)
  2126.     •    bring your dictionary up to date with Update Dictionary
  2127.     •    thereafter, bring your dictionary up to date whenever you want your
  2128.         dictionary to reflect new or altered definitions.
  2129.     •    to switch to a different project that you've had open recently,
  2130.         <Option> or <Command> click in your current project window's
  2131.         title bar to pick from a popup list (please see "Switching to
  2132.         other projects" below -- <Option>clicking will close all your
  2133.         text windows, whereas <Command>clicking will not)
  2134.     •    things work best if you include definitions for all the
  2135.         names in your source code, especially toolbox terms but also
  2136.         PowerPlant or TCL, and ANSI headers.
  2137.  
  2138. NOTE if a folder's name is in parentheses, the files in it will not
  2139. be added to your project. To exclude a folder such as "Old Source",
  2140. change its name to "(Old Source)".
  2141.  
  2142. The three lists of files in the project window can be used to open
  2143. files, by double-clicking on the file names listed there. You can set
  2144. up a multi-file selection by holding down the <Option> key and clicking
  2145. on or dragging over file names, or select all files of a certain type
  2146. by using the buttons in the Find dialog. Bullets (•) will appear beside
  2147. selected files. This list of files can be used with multi-file
  2148. searching or passed as input to a hAWK program or one of the
  2149. “Index” commands under the EnterAct menu. You can also remove
  2150. the selected files from the project with Remove •'d Files.
  2151.  
  2152. To exclude a file from being built into your dictionary, hold down the
  2153. <Command> key and click on its name (more on this later).
  2154.  
  2155. Other things you can do with the lists of project files:
  2156.     •    Find all or part of a file name (useful with enormous lists, have
  2157.         the project window in front and select the appropriate list before
  2158.         using Find or Find Again)
  2159.     •    Copy a selected file name
  2160.     •    use the up and down arrows to move up and down the file lists, and
  2161.         the left and right arrows to change panes
  2162.     •    type your way to a particular file in a pane, by typing the first part
  2163.         or any distinctive part of the name (priority given in that order)
  2164.     •    open a file by selecting it and issuing the Go To command
  2165. The project window goes to the back whenever you open a file from it,
  2166. and is listed under the Windows menu as the first file. Any project
  2167. files that you have open when you close a project are remembered, and
  2168. reopened as you left them when you reopen the project.
  2169.  
  2170. The dictionary is required by regular lookup (click just after a term
  2171. name and press the <Enter> key), and by the AutoLook window which
  2172. displays definitions and prototypes automatically as you edit or mouse
  2173. around. More on this later, of course.
  2174.  
  2175. Only one project can be open at a time. You don’t need to have a
  2176. project open to use EnterAct as an editor.
  2177.  
  2178.  
  2179. §    Project files
  2180. An EnterAct project can track any set of TEXT or PICT files. The source
  2181. and header files don’t have to add up to a compilable
  2182. application—anywhere from one file to part or all of the source and
  2183. documentation for several applications can be an EnterAct project. The
  2184. only practical limit is available memory, since your entire dictionary
  2185. is kept in memory: allow EnterAct 4 Meg if you can, otherwise you
  2186. may have to delete some of the larger unneeded header files from
  2187. your project.
  2188.  
  2189. An EnterAct project can contain files from up to 6 disks. If your
  2190. project files are split across several disks, you should have all the
  2191. disks on–line (mounted) before updating your dictionary or doing things
  2192. with a multi–file selection. EnterAct tracks your disks by name, and
  2193. many other applications do the same, so please ensure that all your
  2194. disks have different names. If you ever find it necessary to move a
  2195. considerable number of files from one folder or disk to another, the
  2196. simplest way to deal with the change in any EnterAct project that
  2197. refers to those files is to throw the project away and create an new
  2198. one. Or, you can use Remove •'d Files (<Option>drag over the file names
  2199. first in the project window so that bullets (•) appear to the left of
  2200. the names) followed by Add Files and then Update Dictionary afterwards
  2201. to update your project. And a third way, slightly more complicated:
  2202.     •    before moving the files, select all files for multi-file ops
  2203.     (call up the Find dialog and click "All")
  2204.     •    run the hAWK program "$EchoFullPathNames", and use
  2205.     Save As to save the resulting list of full path names
  2206.     • move the files
  2207.     • edit the disk or folder names in your list of full path names
  2208.     to reflect the new locations
  2209.     • create a new EnterAct project, hold down the <Shift> key,
  2210.     and select Add Files from List… - double-click on the file
  2211.     you created that contains the full path names.
  2212. (A fourth way to relocate files, activating the "Relocate files
  2213. automatically" option in the Options dialog, works only if all
  2214. your source and header files have unique names within the
  2215. context of their disks, and works only if you change the folder
  2216. where they reside - it doesn't work if you change disks. Use of
  2217. this option is NOT recommended, unless you're quite sure that
  2218. your files have unique names on their disks.)
  2219. EnterAct can handle the following changes to file and folders
  2220. without requiring you to make a new project:
  2221.     • renaming a folder
  2222.     • moving a folder around within one disk
  2223.     • moving a file to a different folder, provided the file
  2224.     name is unique on the disk, if you activate the "Relocate
  2225.     files automatically" option (see just above, not recommended
  2226.     for casual use)
  2227. As mentioned, EnterAct cannot track files if you move them
  2228. to a different disk, unless the two disks involved have the
  2229. same name. 
  2230.  
  2231. Tip: if you often restore you project files from another disk,
  2232. try using a smart copy utility such as CopyDoubler™ or equivalent:
  2233. this will preserve all folders involved, and EnterAct won't lose
  2234. track of any files due to two or more files having the same name.
  2235.  
  2236. §    Creating a project
  2237. Select New Project from the EnterAct menu at any time. When you start
  2238. EnterAct by double–clicking on its icon, you’ll see the New Project
  2239. dialog if you cancel the Open Project dialog that appears first during
  2240. the startup. Since the the project will always be saved for you
  2241. automatically, there’s no such thing as an “Untitled” project: you’ll
  2242. have to give it a home on your disk before doing anything with it.
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256. You can also use Save As to create a copy of an existing project. This
  2257. is a quicker approach if you want a basic set of files to be added to
  2258. a fresh project. To create a “starter” project, once you have a list
  2259. of files in mind:
  2260.     •    create a project that contains just the basic files, and give it
  2261.         a name that reflects its status as a “starter”
  2262.     •    bring the dictionary up to date, so this only has to be done once
  2263.         for the basic files
  2264.     •    set the font, size, and screen placement of the project window.
  2265.  
  2266. Thereafter, to use a “starter” project as the basis of a new project:
  2267.     •    open the starter project
  2268.     •    immediately use Save As, and give it an appropriate name
  2269.     •    proceed as with a new project, adding files and building the
  2270.         dictionary.
  2271.  
  2272. Candidates for inclusion in a “starter” project include toolbox headers
  2273. (omitting the ones you don’t need reduces memory needs) and the on-disk
  2274. manuals supplied with EnterAct. If you’re an object-oriented sort, then
  2275. many of the files in your class library of choice will qualify
  2276. as well.
  2277.  
  2278. §    Selecting your <system> folder
  2279. When you create a new project, a second dialog will appear asking you to
  2280. select the folder to designate as the <system> folder: this is the
  2281. folder where the "Add Mac Headers" command will search for your
  2282. Mac headers ("Quickdraw.h and friends), and it is also the folder used
  2283. to distinguish between All ".h" and All <.h> (or .c) in the Find dialog
  2284. when you are selecting files to search.
  2285.  
  2286. If you cancel the "Select <system> Folder" dialog when creating
  2287. a project, the folder that contains EnterAct itself will be used
  2288. by default. So the best place to put EnterAct on your disk is next
  2289. to the compiler you use most.
  2290.  
  2291. You can change the designated <system> folder for a project at
  2292. any time by using the "Select <system> Folder...." command under
  2293. the EnterAct menu.
  2294.  
  2295. §    Three panes—.c, .h, plain text
  2296. Any files you add to your project whose names end in .c, .C, .cp,
  2297. .CP, .cpp, or .CPP (source files) will be placed in the left pane.
  2298. Header files (ending in .h or .H) will go in the middle pane, and any
  2299. other TEXT files that you add will end up in the right pane. PICT’s
  2300. will also be placed in the right pane. If you have special file
  2301. extensions after a period, eg “.Proto”, that you would like to have
  2302. treated as source or header files, see the “Custom file extensions”
  2303. section a few pages on.
  2304.  
  2305. The dictionary-builder does not look at files in the right pane, which
  2306. is reserved for documentation. However, it will extract definitions
  2307. and prototypes from all files in the left and middle panes, so all
  2308. files added to these panes should be in C/C++, or at least intend to
  2309. be C/C++ when they grow up.
  2310.  
  2311. Since a file’s extension entirely determines the pane it will be added
  2312. to, you can force the file to be added to a particular pane by altering
  2313. its name to give it the appropriate extension. For example, if you have
  2314. a source file “OldMain.c” that you want placed in the right
  2315. (documentation) pane, alter its extension to something that is not
  2316. registered as an extension for the left or middle panes. With no custom
  2317. extensions, a name such as “OldMain.co” or “OldMain.ç” or “OldMain”
  2318. would force the file into the rightmost pane.
  2319.  
  2320. In each pane, the files are sorted alphabetically by name. Since
  2321. EnterAct is not a compiler, there’s no need to set up code segments.
  2322.  
  2323. If you add more than one file with the same name, truncated full path
  2324. names will be shown to the right of the names so that you can tell
  2325. which one is which.
  2326.  
  2327. §    Add Files—the one-at-a-time way
  2328. The Add Files command will let you repeatedly add files (one at a time)
  2329. to your project, until you cancel the dialog. The appropriate pane for
  2330. each file will be chosen for you. The type of the file you add can be
  2331. TEXT or PICT.
  2332.  
  2333. §    Adding files from a list
  2334. The Add Files from List… command appears in place of
  2335. the Add Files command when you hold down the <Shift> or <Option> key.
  2336. A standard Open dialog will appear, in which you should select a text
  2337. file that contains a list of full path names of files to be added to your
  2338. project, one name per line. Within EnterAct, a list of full path names
  2339. can be generated by selecting the desired files in your project for
  2340. multi-file operations (hold down the <Option> key and click on the files
  2341. in your project window), and then running the hAWK program
  2342. $EchoFullPathNames. See the “Search” chapter for multi-file
  2343. selections, and Appendix 2 for hAWK.
  2344.  
  2345. Recommended, for important projects take a minute to produce
  2346. a list of all files in your project:
  2347. •    with the project open, call up Find and click the "All" button
  2348.     to place bullets beside all files (just make sure all disks for
  2349.     the files are mounted)
  2350. • select "hAWK", pick the $EchoFullPathNames program from the
  2351.     top popup menu, and click "Run"
  2352. •    Save the resulting document as "MyProj Files" or equivalent.
  2353. Later, if you need to recreate the project, you can do so quickly
  2354. with the Add Files from List… command.
  2355.  
  2356.  
  2357. §    Add All In Folder—the fast way
  2358. To add all files in a folder to your project:
  2359.     •    select Add All In Folder
  2360.     •    select a folder that contains files to be added
  2361.     •    click on the button with the folder's name at bottom
  2362.     •    do another folder, or Cancel
  2363. When you click the bottom button, all TEXT files in
  2364. the folder will be added to your project. Files in subfolders will not
  2365. be added. This command will also repeat until you click the Cancel
  2366. button. As with Add Files, there’s no need to select a project pane
  2367. beforehand.
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.  
  2398. (Clicking on the "CEDARL_Source" button would add all files in that
  2399. folder to the project, and also all files in subfolders if the <Shift>
  2400. key was down while picking the "Add Files" menu item.)
  2401.  
  2402. To add all files in all subfolders to your project as well, hold down
  2403. the <Shift> or <Option> key while picking  Add All In Folder (the key
  2404. command won’t work with the <Option> key, just the <Shift> key). Then
  2405. select a folder and click on the bottom button with its name.
  2406. .Note that <Command><period> will interrupt this all-inclusive
  2407. version of Add All In Folder, in case you start in the wrong place.
  2408.  
  2409. You can also select and add individual files with the Add All
  2410. command, but note this will have exactly the same effect
  2411. as selecting the folder that contains the file, adding all
  2412. files in the folder (and optionally subfolders).
  2413.  
  2414. §    Add Mac Headers
  2415. The Add Mac Headers command will search the folder that contains
  2416. EnterAct and all sub–folders for the file “Quickdraw.h”. Wherever it
  2417. is found, all files in that folder will be added. If not found, you will
  2418. see a message from EnterAct mentioning that “Quickdraw.h” wasn’t found
  2419. anywhere. You can add these headers yourself with the Add All
  2420. In Folder command.
  2421.  
  2422. If you hold down the <Shift> or <Option> key while selecting this
  2423. command, then in addition Add THINK Headers will also be done (see just
  2424. below).
  2425.  
  2426.  
  2427. §    Add THINK Headers
  2428. This command will add all files in the folder containing “THINK.h” to
  2429. your project. These include “asm.h”, “pascal.h”, “SANE.h” etc.
  2430. If you're using CodeWarrior or MPW, this command doesn't do much.
  2431.  
  2432.  
  2433. §    Add Standard C Headers
  2434. This command will add all files in the folder containing “stdio.h” to
  2435. your project.
  2436.  
  2437.  
  2438. §    The active pane
  2439. When you click in one of the three file lists it becomes the active
  2440. pane, as indicated by highlighting of the file name you click on, and
  2441. activation of the scroll bars for that pane. You can also switch
  2442. between panes by using the left and right arrow keys.
  2443.  
  2444. Some project-related commands such as Update Dictionary and Find In
  2445. Next File are independent of the active pane, while others act within
  2446. a particular pane. Here’s a list of commands and features which apply
  2447. to the active pane:
  2448.     •    the active pane is relevant only when the project window is in
  2449.         front, in which case one of the file names in the active pane will be
  2450.         highlighted, and the scroll bars will be active
  2451.     •    to scroll the currently-selected file in the active pane into view,
  2452.         press <Enter>
  2453.     •    as you drag about in the active pane the currently-selected file
  2454.         will change to keep up with your mouse, with full autoscrolling
  2455.     •    to move up and down the list of files in the active pane, use the
  2456.         up and down arrows. <Option><up arrow> selects the first file in the
  2457.         pane, and <Option><down arrow> selects the last file
  2458.     •    to change panes, click in the pane you want or use the <left arrow>
  2459.         and <right arrow> keys
  2460.     •    type part of a file name to advance to a particular file in the
  2461.         active pane, eg type "mou" to advance to either "Mouse.h" or
  2462.         "MAIN_Mouse.h" -- a match on the first part of the name is tried
  2463.         first, and if that fails then a match anywhere within the name counts
  2464.     •    Copy will copy the currently-selected file name in the active pane
  2465.     •    double-clicking on a file name opens the file, and the
  2466.         currently-selected file in the active pane can be opened with the Go
  2467.         to command
  2468.     •    the active pane is searchable with the Find and Find Again commands
  2469.         when the project window is in front, or just behind the Find dialog.
  2470.         Note that when the Find dialog is immediately in front of the project
  2471.         window the “Find” button will search the list of file names in the
  2472.         active pane, whereas the “Find In Next File” button will search through
  2473.         the contents of those files marked with bullets (•). Searching through
  2474.         the active pane for part of a file name or a file extension is handy
  2475.         when you have a great many files in a pane
  2476.     •    Remove File removes the currently-selected file in the active pane
  2477.         from the project, deleting both the file name and the associated
  2478.         dictionary entries.
  2479.  
  2480. §    Remove File
  2481. To remove one file from a project, bring the project window to the
  2482. front, select the file by clicking on it, and then select Remove File.
  2483. If you have built a dictionary for the project, the dictionary will
  2484. be automatically updated for you.
  2485.  
  2486.  
  2487. §    Remove •'d Files
  2488. The “•” refers to files in the project window that have been marked
  2489. for multi–file operations (a bullet • appears to the left of the file
  2490. name). Before issuing this command, first mark the files that you wish
  2491. to remove with bullets (<Option>drag over the files in the project
  2492. window). You can also mark all files of a particular type by using the
  2493. buttons in the Find dialog.
  2494.  
  2495. Any dictionary entries associated with the file will also be deleted.
  2496. See the next chapter for a description of your project dictionary.
  2497.  
  2498. By the way, this is the only command in EnterAct that will pay
  2499. attention to bullets beside PICT file names. All other commands which
  2500. deal will your list of bulleted files (such as Find In Next File, or
  2501. passing the list as input to a hAWK program) will quietly ignore the
  2502. PICT files, since all other multi-file commands deal only with text
  2503. files.
  2504.  
  2505.  
  2506. §    Custom file extensions
  2507. The File Extensions command under the EnterAct menu allows you
  2508. to specify additional file extensions beyond the standard .c, .C, .h,
  2509. .H etc. Type in your own extensions (up to 6 extensions, each up to
  2510. 5 characters), and pick which pane the file should be added to. For
  2511. example to have “.Proto” files added to the middle pane, type in
  2512. “Proto” (don't type the period) in one of the extension fields and
  2513. click the corresponding “Mid pane” button. Extensions are
  2514. case-sensitive, so “PROTO” is not the same as “Proto”. If you have
  2515. multiple versions of the same extension, you should enter them
  2516. separately.
  2517.  
  2518. If a project is open when you pick File Extensions the extensions you
  2519. enter will apply to that project only, as indicated by the “This
  2520. project” button. If no project is open at the time, the extensions will
  2521. be used for any new project you create (the bottom-left button will
  2522. read “New projects” in this case).
  2523.  
  2524. Please note any file that is added to the left or middle panes will
  2525. be parsed, and terms contained will be built into your dictionary, as
  2526. explained in the next chapter on dictionaries. This means the files
  2527. must be in C/C++ (or at least “C--”), otherwise the dictionary builder
  2528. will complain.
  2529.  
  2530. One use for this that you might like to explore later is creating your
  2531. own “.Note” files. The “.Note” extension will remind you of their
  2532. contents, namely hyperlinked notes on any subject that can be called
  2533. up with a click and press of the <Enter> key. This is described at
  2534. length in the “Lookup” chapter, which you’ll get to eventually if you
  2535. just keep reading along.
  2536.  
  2537. Here’s what the File Extensions dialog looks like:
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560. §    Distinguishing ".h" from <.h>
  2561. The ".h" and <.h> buttons in the Find dialog let you set up a
  2562. multi–file search for just one kind of header (ie system or your own),
  2563. and since bullets • are shown beside selected files selecting one or
  2564. the other kind will give you an on–screen way of telling which are
  2565. which. Similarly, the ".c" and <.c> buttons allow you to select
  2566. source files in either your project folder or your system folder
  2567. for multi-file operations such as searching. The "system" folder
  2568. is the one that contains EnterAct.
  2569.  
  2570. Note for this to work properly your system headers should be in the
  2571. same folder as EnterAct itself, and your own headers should be in a
  2572. folder outside the one that holds EnterAct.
  2573.  
  2574. Technically, this command bullets files in the left or middle pane
  2575. based soley on their disk location. In particular, any files with
  2576. custom file extensions such as “PROTO” or “Notes” will end up with
  2577. bullets if they they fall in the category selected (<.h> and <.c> for
  2578. EnterAct’s folder, ".h" and ".c" for elsewhere).
  2579.  
  2580. §    Copy and search in the project window
  2581. When you have a file name selected in the project window, you can Copy
  2582. it and then Paste it into a text window. This helps sometimes with
  2583. documentation. 
  2584.  
  2585. With the project window in front, pressing any key will scroll the
  2586. current project pane to the first file name that begins with the single
  2587. character you typed. This is something like a file open dialog, but
  2588. responds to just one character at a time.
  2589.  
  2590. And, if you have an enormous project, the Find dialog will let you
  2591. search for part or all of a file name in a particular pane. Select the
  2592. pane in the project window that you wish to search, call up the Find
  2593. dialog, and then continue as though you were searching for something
  2594. in a text document.
  2595.  
  2596.  
  2597. §    Project memory needs
  2598. EnterAct will be keeping your entire project dictionary in memory, for
  2599. rapid access, and this does place a practical limit on the size of a
  2600. project. Roughly, the memory needed will amount to 500K for basic
  2601. operations plus 16% of the size of all source (left-pane) files plus
  2602. 120% of the size of all header (middle-pane) files, with “size” meaning
  2603. the size of a file’s data fork in bytes, rather than the disk space
  2604. used. Note that toolbox and other header files can take a large memory
  2605. bite, so if memory becomes tight your greatest savings can be realised
  2606. by removing header files that you don’t really need built into your
  2607. dictionary.
  2608.  
  2609. As a rule of thumb, give a small project about 2 Meg to work with,
  2610. and allow about 4 Meg for a larger one (say 1 Meg of source code with most
  2611. toolbox headers).
  2612.  
  2613. For more details, especially on toolbox headers and their memory needs,
  2614. please see the document “EnterAct memory needs”.
  2615.  
  2616.  
  2617. §    Multi-file selection
  2618. The general notion is to select one or more of the project files listed
  2619. in your project window, and then issue a command that acts on all
  2620. selected files. The classic use is for multi-file searching.
  2621.  
  2622. To create a multi-file selection for your current project:
  2623.     •    (Coarse tuning) in the Find dialog, click on the various buttons
  2624.         that select all files of a particular type
  2625.     •    (Fine tuning) hold down the <Option> key and click on or drag over
  2626.         file names in the project window. This acts as a “toggle”, selecting
  2627.         files if they were not selected and vice versa. The cursor will change
  2628.         to an “eye” when it’s over the project window with the <Option> key
  2629.         down.
  2630. Each file included in your multi-file selection will have a bullet (•)
  2631. to the left of its name in the project window.
  2632.  
  2633. Your multi-file selection can be used in the following ways:
  2634.     •    to carry out a multi-file search; enter the text to be found in the
  2635.         Find dialog, and click the “Find In Next File” button there, or use
  2636.         the equivalent command under the Search menu. For more on this, see
  2637.         the “Search” chapter.
  2638.     •    to remove files from your project; use the Remove •'d Files command
  2639.         described earlier in this chapter
  2640.     •    as input to a hAWK program; for example, to generate a list of full
  2641.         path names for all text files in your multi-file selection:
  2642.         •    select the hAWK command under the EnterAct menu
  2643.         •    use the “Program:" popup menu to select “$EchoFullPathNames”
  2644.         •    click the “Run” button, and wait a bit... the list of full
  2645.             path names will be shown to you in a fresh window.
  2646.     •    as input for one of the “Index" commands, as described in
  2647.         the “‘Index’ commands” chapter.
  2648. For more on hAWK see the “hAWK User’s Manual”.
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677. (Coarse-tune your multi-file selection with buttons in the Find dialog,
  2678. fine-tune it by holding down the <Option> key and dragging over files
  2679. in the project window)
  2680.  
  2681.  
  2682. §    Project context restoration
  2683. When you close a project, or quit with a project open, the project will
  2684. keep a list of all project documents that are open at the time. That’s
  2685. your “context”. The next time you open the project, all of those
  2686. project documents will also be reopened, and placed and scrolled much
  2687. as you left them, and the Browser window will also be brought back if
  2688. you left it open. This is all automatic, so in the rare event that you
  2689. don’t want your context restored, do a Close All before closing the
  2690. project or quitting.
  2691.  
  2692. Some details: your windows will be put back exactly where you left
  2693. them; file errors are suppressed during context restoration, so if a
  2694. document seems to be missing try double–clicking on it in the project
  2695. window; text documents will be restored with your insertion point or
  2696. selection range scrolled into view, to avoid confusion; however, if
  2697. a document is already open, only its window order will be restored;
  2698. and if a document has been edited (anywhere) while the project was
  2699. closed, it won’t be scrolled. Lookup windows and  documents that
  2700. haven’t been added to your project (including “Untitled” windows) are
  2701. not restored. However, AutoLook will be restored.
  2702.  
  2703. If you’re about to switch from one project to another, and want the
  2704. project being closed to remember and restore the open documents, close
  2705. the project before closing any of the documents that you want
  2706. remembered—then open the other project.
  2707.  
  2708. §    Switching to other projects
  2709. <Option> or <Command> click in the title bar of a project window to
  2710. view a popup list of other projects that you have had open.
  2711. When you pick one  from the list, your current project will close and
  2712. the one you picked will open. If you use the <Option> key, you will be
  2713. asked to save any documents that need saving, and all text windows
  2714. will be closed. If you use the <Command> key, all your text windows
  2715. will be left open. Using the <Option> key to close all windows
  2716. between switches is the better approach if all of the files you
  2717. are dealing with are in your projects, since it keeps your screen
  2718. from becoming buried under a sea of windows.
  2719.  
  2720. §    Tips
  2721. When you double–click on a file name in the project window to open a
  2722. file, the project window will at the same time move to the back behind
  2723. all other windows. If the project window becomes hidden, you can bring
  2724. it to the front again by selecting it from the Windows menu or using
  2725. the menu key equivalent <Command><zero> which is always for the project
  2726. window. Since the project window goes all the way front or back with
  2727. a key–stroke or double–click, you can if you wish make the project
  2728. window relatively large and treat it as a sort of backdrop mini–Finder
  2729.  
  2730. If you begin the names of your own header files with a common character
  2731. or group of characters, they will end up grouped together in the middle
  2732. pane of your project window, and similarly for the other panes.
  2733. Remember you don't have to type the prefix to select a file
  2734. in the active pane, you just need to type some distinctive part of
  2735. the name.
  2736.  
  2737. To save time when creating new projects, create one or more “generic”
  2738. projects which include header files that are often needed—and exclude
  2739. headers than aren’t often needed. Select Update Dictionary before
  2740. putting your generic project away. When you want to create a new
  2741. project, open the appropriate generic one and use Save As to give it
  2742. a new name. This way you won’t have to weed out unneeded headers to
  2743. minimize memory needs, and your dictionary will already be up to date
  2744. for the basic headers.
  2745.  
  2746. -    -    -    -    -    -    -    -    -    -    -    -
  2747. Dictionaries
  2748. -    -    -    -    -    -    -    -    -    -    -    -
  2749. §    Introduction
  2750. Once built, a project’s dictionary will contain entries for virtually
  2751. every C/C++ term in every source (left pane) or header (middle pane)
  2752. project file that is not restricted in scope to the body of a function.
  2753. For functions and methods the dictionary entry will
  2754. be the prototype or equivalent, and for all other terms the entry will
  2755. consist of the entire statement in your source code in which the term
  2756. was mentioned or defined. Regular use of Update Dictionary will keep
  2757. your dictionary current as you develop your source code.
  2758.  
  2759. As explained in the next chapter, the main point of having a dictionary
  2760. is to give you instant displays of those definitions and prototypes.
  2761. The AutoLook window shows them automatically as you edit, and more
  2762. detailed and permanent displays can be generated by double-clicking
  2763. on a name and pressing the <Enter> key. You can also jump to the
  2764. definition of any dictionary entry, as explained in the “Seeing where
  2765. a term is defined” chapter. The project dictionary forms the basis for
  2766. the display in the Browser window. And there’s a hAWK built-in function
  2767. that lets you determine the type of a C term within the context of your
  2768. current project (see the hAWK program “$Whazzat”, which
  2769. translates C declarations into English).
  2770.  
  2771. The AutoLook window can also display definitions for local variables.
  2772. For this to work, in addition to having a dictionary you should be
  2773. working inside a function in a source file.
  2774.  
  2775.  
  2776. §    What’s in a dictionary
  2777. After you’ve built your dictionary with the Update Dictionary command
  2778. (see the next section), it will contain entries for everything of
  2779. interest in your current project’s source (left pane) and header
  2780. (middle pane) files that you would want to use in more than one 
  2781. function. Specifically there will be an entry for every:
  2782.     •    function—all types including static, in–line, method
  2783.     •    struct, union, enum, class
  2784.     •    enum constant
  2785.     •    #define—constant and macro
  2786.     •    typedef
  2787.     •    variable—all types including static, low–memory
  2788. —provided only that the term is defined or mentioned outside of a
  2789. function.
  2790. Note that members of classes, structs and unions are included, as
  2791. are prototypes or definitions of methods within class definitions.
  2792. Local variables are not included in your dictionary, but the AutoLook
  2793. window can look at your function to find the variable's defining
  2794. type name (which should be a keyword or something in your
  2795. dictionary).
  2796.  
  2797. Dictionary entries for functions and methods will contain the prototype
  2798. or equivalent. For all other kinds of terms, the dictionary entry will
  2799. consist of the complete C statement in which the term occurs in your
  2800. source code.
  2801.  
  2802. All variants of a particular term will be included as separate entries
  2803. in the dictionary. For example, if your source code contains the
  2804. definition of a function and also a prototype for the function, then
  2805. two entries for the function will be made in the dictionary. 
  2806.  
  2807. When EnterAct runs into conditional inclusion such as
  2808.  “#ifdef SomeThing ...  #else ...#endif”, it picks up definitions
  2809.  in the first part and ignores the "else" or "elif" sections. The
  2810.  parser also ignores anything inside the standard
  2811.  “#if 0 ... #endif” construction.
  2812.  
  2813. §    Building your dictionary
  2814. To exclude a file from being built into your dictionary, hold down
  2815. the <Command> key and click on the file's name in the project
  2816. window. The cursor will change to an 'X' while you do this, and
  2817. a dash '-' will appear to the left of the file name to show that it
  2818. is excluded.
  2819.  
  2820. If you are adding files from a list (via <Shift>Add Files...), you can
  2821. exclude a file from being built into the dictionary by placing an
  2822. exclamation mark at the beginning of its path name, eg to exclude
  2823. the file
  2824.     HardDisk:Folder:src:George.cp
  2825. add a '!' so it reads
  2826.     !HardDisk:Folder:src:George.cp
  2827.  
  2828. After you’ve added all your files to your project, select Update
  2829. Dictionary from the EnterAct menu. If the dictionary–builder stumbles
  2830. over a statement that’s too mangled to parse, you’ll see a message
  2831. explaining in general what the problem is. You’ll also be shown the
  2832. file in question, with the cursor placed at the position where the
  2833. error was detected. Generally, most problems reported will be
  2834. well–localised and fairly easy to fix—typical problems are lack of
  2835. balance for critical delimiters, and missing or very badly spelled
  2836. keywords. If you don’t see what the problem is, consult the “Dictionary
  2837. build problems” section of the “If there’s a problem” chapter.
  2838.  
  2839. EnterAct’s dictionary–builder will properly interpret a great many
  2840. first–draft errors, including missing semi–colons, lack of balance in
  2841. some delimiters (these vary according to context), slightly misspelled
  2842. keywords, and some others. Your source code should mostly make
  2843. sense, but it doesn't have to be perfect.
  2844.  
  2845. In a contrary sort of way, using EnterAct will almost certainly
  2846. reduce your first–draft errors. This is simply because you now have
  2847. instant access to all spellings and types of struct members, all
  2848. function and method calls, etc, so a major source of errors
  2849. is now gone.
  2850.  
  2851. §    Keeping it up to date
  2852. EnterAct does not update your dictionary automatically. Generally, you
  2853. should select Update Dictionary whenever you change or add something
  2854. that you’d like to have in the dictionary. Changes that take place
  2855. entirely within the body of a function will not affect what’s in your
  2856. dictionary. Any changes outside of a function body, including adding
  2857. a new function, adding or changing an enum constant or struct or class
  2858. member etc will be changes that you’d normally like to have reflected
  2859. in your dictionary.
  2860.  
  2861. Update Dictionary checks each file's modification time against the
  2862. time it was last updated by Enteract, so there is no need to "make"
  2863. an EnterAct project as a separate step.
  2864.  
  2865. Update For Front File Only will rebuild only that part of your
  2866. dictionary that is determined by the front text window. Unlike the
  2867. other two update commands, this is a “manual override”, and rebuilds
  2868. the dictionary for the front file whether or not it needs rebuilding.
  2869. Normally you won’t need to use this command, because a full update with
  2870. Update Dictionary for all changed files is almost always very quick.
  2871.  
  2872. There are two special cases in which you’ll probably want to rebuild
  2873. your entire dictionary:
  2874.     •     enabling the “Detect nested comment start” option (see “Option”
  2875.          chapter), after having done a dictionary update with this option
  2876.          disabled
  2877.     •    adding one or more new “macro’s to skip” (see the section on
  2878.         “All-or-nothing macro’s” in the “Source code restrictions chapter)
  2879. To completely rebuild your dictionary, hold down all three of the
  2880. <Shift>, <Option>, and <Command> keys while using the mouse to select
  2881. Update Dictionary (note the key equivalent doesn’t work with this
  2882. variation).
  2883.  
  2884. A small point, but worth noting: if you make a significant change to
  2885. a header file that’s #included in a great many source files, don’t be
  2886. reluctant to bring your dictionary up to date. EnterAct’s dictionary
  2887. builder only needs to scan changed files once, no matter how they are
  2888. #included. The dictionary update will take just a few seconds at most
  2889. (the tedious part, saving the new dictionary to disk, is done
  2890. transparently while you continue to work). For example, on a
  2891. relatively slow machine with a 68040 running at 25 Mhz, a typical
  2892. incremental update will take 5-10 seconds.
  2893.  
  2894.  
  2895. §    How long will it take?
  2896. Typically an update zips along at two to three files per second on a slow
  2897. 68040 machine once it gets going. There is a bit of overhead at the end
  2898. of an update while the browser is rebuilt, roughly three seconds.
  2899. Project dictionary saving is done transparently in the
  2900. background unless you close the project or Quit or issue some other
  2901. command that requires a fully-saved project. You can go back to editing,
  2902. looking things up, searching etc right after the last file is parsed.
  2903.  
  2904. On a Quadra 840 or faster, update speed is simply astonishing.
  2905.  
  2906. As mentioned above, all changed files including "h" files are scanned
  2907. only once during an update.
  2908.  
  2909. Your regular dictionary update will probably involve no more than
  2910. four files, and for this your total time "lost" will typically be under
  2911. under six seconds. On a Quadra 840, blink and you miss it.
  2912.  
  2913. If you need to interrupt the dictionary update, press
  2914. <Command><period>. This also interrupts multi–file searches, and
  2915. printing, and hAWK programs, by the way. You can finish the job off
  2916. properly later by reselecting your original dictionary update command.
  2917.  
  2918.  
  2919. §    Show Dictionary
  2920. (This command is not especially useful, since in practice most
  2921. dictionaries are very big, and you'll run out of memory.)
  2922.  
  2923. This command produces a “raw” dump of all the text in your dictionary,
  2924. consisting of all the definitions or declarations that the
  2925. dictionary–builder extracted from your code. At the top will be a
  2926. comment listing the number of definitions of each type. The entries
  2927. in the dictionary dump will be grouped together by file after a comment
  2928. giving the file name, and within each file will appear in the same
  2929. order as they occurred in the original file. You can use Save As if
  2930. you wish to save your raw dictionary.
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958. -    -    -    -    -    -    -    -    -    -    -    -
  2959. Lookup
  2960. -    -    -    -    -    -    -    -    -    -    -    -
  2961. You can expect that better than 90% of your routine information needs
  2962. will be satisfied by the AutoLook window. For remaining needs, regular
  2963. lookup (press <Enter>) pulls up definitions of terms to separate
  2964. windows, and also works when your spelling is off but “distinctively
  2965. close”. And reverse lookup (<Shift><Enter>) shows definitions of
  2966. structs, unions, and typedefs that contain a particular member, again
  2967. in a separate window.
  2968.  
  2969. Please note that definitions of local variables appear only in the
  2970. AutoLook window, and if you want them in a separate window
  2971. you'll have to do the Copy New Paste thing.
  2972.  
  2973. Lookup and many other features (such as jumping to a definition) are
  2974. fully functional with first-draft code. All lookup windows, including
  2975. AutoLook, are fully editable, but can't be saved.
  2976.  
  2977. EnterAct's lookup features can be used to help out less "language
  2978. aware" editors. If you feel more comfortable working that way,
  2979. see the last section in this chapter (but read just below about
  2980. <Enter> for lookup, <Shift><Enter> for member lookup, and the
  2981. all-important AutoLook window first, please).
  2982.  
  2983. §    AutoLook
  2984. The AutoLook command calls up an automatic lookup window which
  2985. updates by itself to show dictionary entries as you type, edit, or
  2986. click around with the mouse. It will instantly retrieve and display a
  2987. definition for the words that lie just before your insertion point, or
  2988. within your current selection (which can be part of a larger
  2989. word). And it’s just as editable as a regular text window (Cut Copy
  2990. Replace etc), though you can’t save changes to it.
  2991.  
  2992. AutoLook is context-aware: it can determine if a name is a local
  2993. variable, and when dealing with members or methods it tries its
  2994. best to look in the appropriate inheritance chain. If you're in a
  2995. plain document rather than a source file, AutoLook still works,
  2996. but with less accuracy.
  2997.  
  2998. AutoLook can be used to look up a simple name, such as
  2999. "noErr": just click after the name and its definition will appear
  3000. instantly in the AutoLook window (for this one, you'd need to
  3001. add Mac Headers, or at least Types.h, to your project).
  3002.  
  3003. And AutoLook can be used to resolve a complicated "reference
  3004. chain". Taking a C example such as
  3005.     mySFRPtr->sfFile.parID,
  3006. if you clicked after "parID" you would see in AutoLook that it
  3007. is a long member in an FSSpec; and if you clicked after "sfFile",
  3008. AutoLook would show that it is the FSSpec member in a
  3009. StandardFileReply struct. And if you clicked after "mySFRPtr"
  3010. in the function where I took this example, you would see that
  3011. it is a local variable of type "StandardFileReply    *", together
  3012. with the definition of a StandardFileReply. Actually, AutoLook
  3013. is much easier to use than to describe--try it! Just click after
  3014. any name of interest, anywhere.
  3015.  
  3016. Summary:
  3017. • AutoLook shows definitions instantly for terms to the left
  3018. of your insertion point, or within your selection
  3019. • If you're working inside a function in a source file, then the
  3020. AutoLook window will also display definitions for local variables.
  3021. • If you're working within a method, lookup shown for members
  3022. and methods will be more accurate than if you're in a plain
  3023. document
  3024. • Your spelling must be exact for most terms - if you don't see what
  3025. you expected, press the <Enter> key to look up a top-level term,
  3026. or <Shift><Enter> to look up a struct or class member (see below)
  3027. • AutoLook shows supporting definitions for a name when
  3028. appropriate (eg if a name is a variable of type FSSpec, you'll
  3029. also be shown the definition of an FSSpec).
  3030.  
  3031. For another example, if there are entries in your current dictionary for
  3032. “Window”, “WindowData”, and “WindowDataPtr”, then all three entries
  3033. will appear in succesion in the AutoLook window as you type
  3034. “WindowDataPtr”. Selecting “Ptr” will call up the definition of “Ptr”,
  3035. whereas selecting (or clicking after) “contained within the
  3036. WindowDataPtr” will call up the definition of “WindowDataPtr”.
  3037. In both of these latter cases, the full definition of the "WindowData"
  3038. struct will appear in the AutoLook window.
  3039.  
  3040. If the definition of the word involves obvious typedefs,
  3041. #defines, or structs or unions, definitions for them will be appended to the
  3042. AutoLook display—for example, if you double-click on a global variable
  3043. gEvtDetails you won’t see just
  3044.     EventDetails        gEvtDetails ;
  3045. you’ll also see what an EventDetails thing is defined to be.
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067. (as of v3.5, we skip the "middlemen", for example the typedef of
  3068. "EventDetails" above, if it adds nothing to comprehension)
  3069.  
  3070. As mentioned, the AutoLook window produces fast accurate lookup for
  3071. data members, when you're working in a method. Click after or
  3072. double-click on the data member's name, as usual, and the
  3073. declaration for the data member will appear in the AutoLook
  3074. window, followed by any supporting definitions -- eg "Thing
  3075. *dataMember;" would be followed by the definition of "Thing". The
  3076. display box in the AutoLook window will tell you which class
  3077. definition the declaration was found in, either the class that owns
  3078. the method you're working in, or any of the classes it inherits
  3079. from. This "data member" lookup for AutoLook is case-sensitive,
  3080. and the beginning of the name you're looking up must match the
  3081. beginning of the data member's name exactly, to speed things up
  3082. and cut down on spurious matches. Please note that lookup for data
  3083. members that aren't in the current method's inheritance chain
  3084. remains slower and less accurate.
  3085.  
  3086. You will often in C++ have methods defined "inline" within the body
  3087. of a class—yet EnterAct does not record method definitions within
  3088. a class body. In this case, there may be a delay of a second or so
  3089. while AutoLook tries to find an appropriate class definition -- note
  3090. if you type or click during this search it will be interrupted.
  3091. Otherwise, AutoLook will unobtrusively search through the bodies of
  3092. all the class definitions in your project, and show you the first class
  3093. definition it finds that mentions the method. AutoLook will often
  3094. preferentially show a function prototype if one exists for a name,
  3095. but it will also show a class definition if there is one with the
  3096. same name, since constructors and classes have the same name
  3097. and it's difficult to tell which one you want to see.
  3098.  
  3099. §    Regular lookup (press <Enter>)
  3100. The AutoLook window changes as you work, doesn't show all
  3101. variants, and works only with correct spelling. To produce a more
  3102. permanent display of a definition, or a display listing all variant
  3103. definitions of a name, or to pull up a definition for a name when
  3104. you’ve forgotten the correct spelling, press the <Enter> key. You can
  3105. either double-click on the name or type it in or click just to the
  3106. right of it, then press <Enter>.  For a list of the different types
  3107. of terms you can look up, see the beginning of the previous chapter
  3108. “Dictionaries”. As a special case, note that local variables are
  3109. not in your dictonary and so definitions for them will show only
  3110. in the AutoLook window. This may change in a future version.
  3111. Hey, the top of the function isn't that far away. To toggle between
  3112. your working position and the top of a function, use the "Go Back"
  3113. command. To produce a more permanent display of a local definition,
  3114. you'll have to manually copy it to another window.
  3115.  
  3116. Lookup windows also provide a context for jumping to one of
  3117. several definitions for a term, as described in chapter 11,
  3118. "Seeing where a term is defined."
  3119.  
  3120. Back to pushing the <Enter> key: definitions that match or come
  3121. closest to the term you’re looking up will be displayed in a new
  3122. “lookup” window. It looks like a regular text window, but the title
  3123. of the window will be the term you’re looking up, preceded by
  3124. two bullets (••). Text in the window can be edited (Cut Copy
  3125. Replace etc), but changes are temporary.
  3126.  
  3127. In the display box along the bottom of the window you will see the name
  3128. of the file from which the definition was taken, followed by a number
  3129. such as “1/4” indicating that the definition is the first of four
  3130. available in the window. This number can range from “1/1” to “1/60”.
  3131. In all lookup windows, to view other definitions:
  3132.  
  3133.     •    hold down the <Option> key (or the <Command> key)
  3134.     •    click-and-drag in the lookup window’s title bar
  3135.     •    select from the resulting popup menu describing the definitions.
  3136. Or, press the <Enter> key to view the next available definition,
  3137. <Option><Enter> to view the previous one.
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155. (The display box is now on the left side, but otherwise unchanged)
  3156.  
  3157. (Double-clicking on “KeyDetails” and pressing the <Enter> key produced
  3158. the “••KeyDetails” lookup window. The cursor is caught in the act of
  3159. an <Option>click in the title bar of the lookup window.)
  3160.  
  3161. When your spelling is exact, the lookup window will contain all variant
  3162. definitions of the term. For example, there will often be a defining
  3163. instance and prototype for a function, and quite often a struct and
  3164. a typedef with the same name will exist.
  3165.  
  3166. Unlike AutoLook, regular lookup works even if your spelling is off.
  3167. There are no arcane rules to memorize concerning what to type if you
  3168. can’t remember the exact spelling of a term: just type your best guess.
  3169. Do use the correct case though, because regular lookup is
  3170. case-sensitive, the same as C itself. OK, regular lookup will compensate
  3171. instantly for a single case error, but otherwise it will start looking
  3172. for best matches through your whole dictionary, and this takes a
  3173. second or two.
  3174.  
  3175. If your spelling was off, the lookup window will hold definitions for
  3176. terms that best match what you typed, in order according to how well
  3177. they match. In this case, you control how many matches are available
  3178. in the lookup window (see “Number of entries per lookup” later in this
  3179. chapter, it's a field in the Options dialog).
  3180.  
  3181. When your spelling is incorrect, EnterAct first checks for common
  3182. errors such as full spelling when an abbreviation is needed, use of
  3183. a common synonym, permutations, and single case errors. Up to this
  3184. point, regular lookup is instant. If no match is yet found, EnterAct
  3185. then checks all entries in your dictionary and locates the ones that
  3186. best match what you typed, based on runs of matching characters. This
  3187. phase may take several seconds, but is still much faster and easier
  3188. than searching though files yourself. Very much faster.
  3189.  
  3190. As each definition appears in a lookup window, a selection is made for
  3191. you. For functions, the function name and parameter list are selected,
  3192. and for all other terms the name of the term itself is selected.
  3193.  
  3194. Here’s a general example illustrating typical use of regular lookup:
  3195.     •    you type the name of a function in one of your working windows, but
  3196.         the AutoLook window doesn’t change: this means your spelling was off
  3197.     •    press the <Enter> key, and a lookup window appears, holding several
  3198.         definitions that come closest to your spelling
  3199.     •    the first one shown isn’t the one you wanted: press <Enter>
  3200.         repeatedly to advance through the definitions. Normally the one you
  3201.         want will be among the first three. Or, hold down the <Option>
  3202.         or <Command> key and click-and-drag in the title bar to pick
  3203.         from a popup menu of alternates
  3204.     •    viewing the function you want, use Paste Selection Behind to copy
  3205.         the function name and parameters which have been selected for you,
  3206.         return to your working window, and paste the function name (now
  3207.         correctly spelled) and parameter list over your guess—all in one step.
  3208.  
  3209. §    <Enter> for lookup, advancing, scrolling
  3210. Pressing the <Enter> key in a normal text window means “look this up”,
  3211. but in a lookup window it can also mean “advance to the next
  3212. definition”. The different behavior corresponds to your intent. Here
  3213. are the rules for <Enter> in a lookup window:
  3214.     •    to look up a name shown in a lookup window definition, double-click
  3215.         on it or click after it or type it in and press <Enter>. This is the
  3216.         same as in a regular text window.
  3217.     •    to cycle to the next definition; if you haven’t altered the default
  3218.         selection made for you in the lookup window, press <Enter>. If you have
  3219.         altered the selection, use Select All before pressing <Enter>. If your
  3220.         selection is so large that it couldn’t represent a word to be looked
  3221.         up, or if it agrees with the name of the definition already being shown
  3222.         in the lookup window, EnterAct will cycle you to the next definition.
  3223. The same rules apply to <Option><Enter>, which takes you back to the
  3224. preceding definition in a lookup window, but also does “sounds like”
  3225. lookup as described as few sections ahead.
  3226.  
  3227. By the way, using the <Enter> key to just scroll the top-left of your
  3228. selection into view or to toggle between showing the top and bottom
  3229. portion of a large selection still works, the same as in ordinary
  3230. editors. Once again, it comes down to your intent: try the <Enter> key
  3231. out to do lookup, advancing through definitions, and scrolling your
  3232. selection and you should quickly find that you can treat it as a “Do
  3233. What I Mean” button. On the rare occasion when it doesn't do what
  3234. you mean, whack it twice quickly. That'll teach it.
  3235.  
  3236. §    Looking up the clip (press <Command><Enter>)
  3237. To look up the last word on the clipboard, hold down the <Command> key
  3238. while pressing <Enter>. EnterAct’s private clipboard is updated when
  3239. you switch in and out. So to look up a term encountered while using
  3240. some other editor:
  3241.     •    Copy just the term
  3242.     •    switch to EnterAct (an appropriate project with built dictionary
  3243.         should be open)
  3244.     •    hit <Command><Enter>
  3245. A lookup window will appear after you press the <Enter> key, showing
  3246. the dictionary entry that best matches what you typed, or those that
  3247. come closest if your spelling erred, just as if you typed the word in
  3248. a text window and pressed <Enter>.
  3249.     ••• OR just leave your AutoLook window in front -- when you return
  3250.         to EnterAct, the AutoLook window will automatically display
  3251.         whatever info it can for the last word on the clipboard. This
  3252.         lets you use EnterAct as a high-speed lookup helper when
  3253.         you're working mainly with some other editor. Just arrange
  3254.         your windows so that you can see the AutoLook window when
  3255.         you're in the other editor, then having a definition in view is
  3256.         as easy as Copy, click on the AutoLook window, click on your
  3257.         other editor's window. 
  3258.  
  3259.  
  3260. §    Reverse lookup (press <Shift><Enter>)
  3261. To retrieve all struct, typedef, and union definitions that contain
  3262. a word or phrase, select the word or phrase, or click after just a
  3263. single word, and press <Shift><Enter>. Reverse lookup is not
  3264. case-sensitive, but otherwise your spelling must be exact. It’s very
  3265. fast, though not instant.
  3266.  
  3267. Results are shown in a lookup window, and you can view the different
  3268. definitions either by pressing <Enter> to advance to the next
  3269. definition, <Option><Enter> to view the previous one, or by
  3270. <Option>clicking in the lookup window’s title bar.
  3271.  
  3272. Here’s the lookup window that results from typing ParamBlockHeader and
  3273. pressing <Shift><Enter>, with the dictionary containing most toolbox
  3274. headers:
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294. (<Option>click in the title bar for the popup listing definitions in
  3295. any lookup window. “PARAMBLOCKHEADERS” would work just
  3296. as well as “ParamBlockHeader”, and “paramblockh”
  3297. would have produced similar results, perhaps with a few more
  3298. definitions shown.)
  3299.  
  3300. Reverse lookup works with a single word or a phrase up to 255
  3301. characters, and just looks for a match in struct, union and typedef
  3302. definitions regardless of where the text occurs. The most common use
  3303. is to look up a member name, but you can also use it to look up a
  3304. distinctive word or phrase in a comment that you recall seeing, perhaps
  3305. in one of your own “popup notes”, as described in “Looking up your
  3306. notes” later in this chapter.
  3307.  
  3308. As of version 3 of EnterAct, the text you're looking up must begin
  3309. with the start of a word for reverse lookup, but need not end with
  3310. a complete word.
  3311.  
  3312. §    “Sounds like” lookup (press <Option><Enter>)
  3313. When you can’t remember what case conventions were used for a name,
  3314. or your recollection of the spelling is very very vague, type in your
  3315. best guess and try <Option><Enter> instead of just plain <Enter>. This
  3316. activates “sounds like” or “phonetic” rather than regular lookup. Upper
  3317. and lower case are treated as the same, vowels are used to determine
  3318. what the surrounding consonants sound like, and consonants are
  3319. converted to standard phonetic equivalents in your guess. This “boiled
  3320. down” version of your guess is then compared with similarly boiled-down
  3321. versions of all names in your dictionary, and you will be shown the
  3322. definitions of the ones that come closest in the resulting lookup
  3323. window.
  3324.  
  3325. The different definitions available can be viewed in the same way as
  3326. with regular lookup windows: use <Enter> and <Option><Enter> to cycle
  3327. forwards and back, or <Option>click in the title bar and choose from
  3328. the popup menu.
  3329.  
  3330. Sounds-like lookup should be kept in mind as an “emergency backup”,
  3331. worth trying if regular lookup doesn’t bring up the definition you want
  3332.  
  3333. As an example, suppose you’re after the definition of ParamBlockHeader,
  3334. but misremember it as PARAMHEAD. Regular plain-<Enter> lookup would
  3335. fail in this case, since it is case-sensitive. Pressing <Option><Enter>
  3336. would work, but might also call up spurious matches (who knows what,
  3337. perhaps kPrimeHidden) since it largely ignores vowels. On the other
  3338. hand, if you misremember CopyFile as KoppeePheill then sounds-like
  3339. lookup will work, and I imagine you won’t be complaining about the few
  3340. extra spurious matches that it throws up.
  3341.  
  3342.  
  3343. §    Viewing other entries in lookup windows
  3344. <Enter> and <Option><Enter> take you forwards and backwards through
  3345. the different definitions available in any lookup window, as described
  3346. in the section “<Enter> for lookup, advancing, scrolling” a couple of
  3347. pages back.
  3348.  
  3349. For a quick overview of all entries in the lookup window, hold down
  3350. the <Option> or <Command> key and click (and drag) in the lookup
  3351. window’s title bar. A popup menu will appear, listing the first line
  3352. from each entry (or at least a good part of it), and you can go to the
  3353. entry by selecting it from the menu.
  3354.  
  3355. The first letter in each menu item indicates the type of the entry ('v’
  3356. for variable, ‘(’ for function, ‘#’ for define etc). For details, see
  3357. “Hints with lookup” below.
  3358.  
  3359. (<Option>click-and-drag in the title bar)
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367. §    For faster lookup
  3368. If lookup on average takes longer than you’re willing to wait when your
  3369. spelling is off, the simplest cure is to trim unneeded files from your
  3370. project, thus reducing the size of your dictionary. See “Project memory
  3371. needs” in the “Projects” chapter for a guide to trimming files, and
  3372. also the document “EnterAct memory needs”. Regular lookup for exact
  3373. spelling is always instant, and reverse lookup nearly so.
  3374.  
  3375.  
  3376. §    Hints with lookup
  3377. When you type in a name and press <Enter>, you know what “kind of
  3378. thing” you want, but EnterAct doesn’t. Supplying EnterAct with a quick
  3379. hint will help speed up the lookup if your spelling doesn’t match an
  3380. entry, and it will in all cases limit the entries that are retrieved
  3381. to the type that you specify with the hint.
  3382.  
  3383. A hint for lookup consists of one character added after the name you
  3384. wish looked up. Normally you’ll need to first type a space and then
  3385. the one–character hint, to separate it from the name. However, the hint
  3386. for a function “(” and the hint for a #define “#” can’t be part of any
  3387. name, so the space is optional for these two.
  3388.  
  3389. Here are the hints you can supply, with examples: in all cases you
  3390. should select an insertion point just to the right of the hint just
  3391. before pressing <Enter> so that EnterAct can pick up the hint
  3392. correctly, or select the word and the hint. For all except the function
  3393. and #define hints, a bit of space (blanks or tabs) between the name
  3394. and the hint is necessary.
  3395.  
  3396. Type                            Hint        Example
  3397. ----                            ----        -------
  3398. function, method        (            SomeFunc(
  3399. struct, class            s            MyStruct s
  3400. variable                    v            globalVar7 v
  3401. #define                    #            BIGNUM#
  3402. union                        u            IntOrFloat u
  3403. enum                        e            ErrorCodes e
  3404. enum constant            c            eNoMemory c
  3405. typedef                        t            MyStruct t
  3406.  
  3407. In the display box of a lookup window you will see one of the above
  3408. hints for each entry, between the file name and the current entry
  3409. number. This is just to remind you that EnterAct keeps track of what
  3410. kind of thing each term is, and that it will understand the above hints
  3411. if you supply them.
  3412.  
  3413. When should you supply a hint? Almost never. Perhaps when you have a
  3414. struct, a typedef, and a variable that have very similar names, you
  3415. don’t remember the exact spelling, and you want just one of them
  3416. without the nuisance of the others. Since flipping through lookup
  3417. entries is as fast as pressing the <Enter> key once the lookup appears,
  3418. the only common reason to supply a hint is to speed up the lookup
  3419. process itself. But in this case you should first try trimming
  3420. unnecessary files from your project, as this will also speed things
  3421. up by reducing the size of your dictionary.
  3422.  
  3423. §    Number of lookup windows
  3424. With too many lookup windows on–screen at once, your screen will be
  3425. too cluttered. If too few are available, that will hamper you when you
  3426. have a complicated problem to wrestle with. The upshot is that the
  3427. maximum number of lookup windows on–screen at once must be under your
  3428. control, so you can vary this number as the situation demands. You can
  3429. change this number at any time by typing a new number in the “Number
  3430. of lookup windows” box in the Options dialog. The default number is
  3431. 4, but you can vary it from 1 to 10.
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.  
  3452.  
  3453. The “Number of lookup windows” includes any that you mark for keeping
  3454. around, and determines when a lookup window that is not marked for
  3455. keeping around will quietly go away on its own. When you press <Enter>
  3456. to see a new lookup and the lookup window limit has already been
  3457. reached, one of the old lookup windows that was not marked for keeping
  3458. around will quietly go away, and the new one will replace it. There’s
  3459. no predicting which one, so if you want a lookup window to stay up
  3460. until you explicitly close it, select Keep Lookup Around while it is
  3461. the front window ( see “Keeping lookups around” below for details).
  3462.  
  3463.  
  3464. §    Number of entries per lookup
  3465. When your spelling doesn‘t match any term in your dictionary exactly,
  3466. the number of entries that are retrieved in the lookup window is under
  3467. your control. To change this number, select Options and type a new
  3468. number in the “Number of entries per lookup window” box. The default
  3469. of 4 suits most cases, but you may prefer 3 or 5. The maximum of 20
  3470. entries is useful only when your recollection of the correct spelling
  3471. has gone right out the window.
  3472.  
  3473. §    Keeping lookups around
  3474. The command for this is under the Windows menu. When you select Keep
  3475. Lookup Around with a lookup window in front, the lookup will be marked
  3476. for keeping around, which is to say it won’t close unless you close
  3477. it yourself. Other lookups not marked for keeping around may quietly
  3478. close when you ask for a new lookup after having hit the limit on the
  3479. number of lookup windows on–screen at one time.
  3480.  
  3481. When you select Keep Lookup Around for a lookup window, the beginning
  3482. of the window title will change from •• to ¶¶ to show you that it is
  3483. marked for keeping. A ¶ is a Paragraph mark, which starts with P, and
  3484. that stands for Permanent.
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492. A lookup window marked for keeping will close only if you select Close
  3493. or Close All, or close the project, or leave EnterAct. In other words,
  3494. it’s as permanent as a regular text window.
  3495.  
  3496.  
  3497. Since the AutoLook window changes so often, if you want to preserve
  3498. an entry you should look it up in the usual way, by double-clicking
  3499. on or clicking just to the right of the word (or partial word) and
  3500. pressing the <Enter> key. You can do the lookup right in the AutoLook
  3501. window if you wish.
  3502.  
  3503. After you’ve used the AutoLook window for a bit, it serves as a
  3504. spelling checker for top-level C terms. If you don’t detect a slight
  3505. flicker in the AutoLook window out of the corner of your eye when you
  3506. type the name of a term that should be in your dictionary, take a
  3507. glance at the AutoLook window—if the definition or prototype isn’t
  3508. there, you have a spelling error.
  3509.  
  3510.  
  3511. §    Looking up your notes
  3512. Here’s how to build your own hard–won notes and observations about
  3513. programming the Macintosh into your dictionary, for quick retrieval
  3514. by name. You might call them “popup” notes, but as you’ll see, they’re
  3515. just a variation on looking up C terms and the notes appear in the
  3516. AutoLook window or a regular lookup window.
  3517.  
  3518. Note files consist of fake C constructs, the sole content of each
  3519. construct being a comment which contains the specific note. Suppose,
  3520. for example, one of your notes concerns the modification date
  3521. (“modDate”) for a file. To be able to retrieve the note, you first need
  3522. to think of a memorable name for it, such as “modDateNote”. Then, in
  3523. your note file, you would set up the dictionary entry like this:
  3524.  
  3525. struct modDateNote
  3526.     {
  3527.     /*
  3528.     Paste the note in here, within a comment
  3529.     that makes up the entire "struct" body.
  3530.     */
  3531.     };
  3532. The note goes inside a comment, which makes up the body of a struct.
  3533. Placing the note inside a comment is necessary, to prevent the
  3534. dictionary builder from trying to interpret your text as C code. There
  3535. are other constructs you can use, such as
  3536.  
  3537.     #define modDateNote /*
  3538.      Paste the note in here, within a comment
  3539.      that makes up the entire "define" body.
  3540.     */
  3541. or
  3542.     int modDateNote /* your note here
  3543.         in a comment */;
  3544. but a struct is definitely the best, since reverse lookup can then be
  3545. used to retrieve a note based on some distinctive word or phrase that
  3546. it contains.
  3547.  
  3548. Since notes are always placed inside C comments, you should avoid C
  3549. comment starts and ends (/* and */) within the note itself.
  3550.  
  3551. It remains only to persuade EnterAct to build such a file into your
  3552. dictionary. EnterAct will do so for files that are in the left or
  3553. middle pane of your project, and by default if a file name ends in “.c”
  3554. or “.h” etc it is added to the left or middle pane respectively. However,
  3555. a slightly nicer approach is to give your note files an ending that
  3556. describes what they are. A reasonable choice would be “Notes”, and then
  3557. your note files would have names like “File.Notes”, “Memory.Notes”,
  3558. “Interface.Notes”. To instruct EnterAct that files with names ending
  3559. in “Notes” should go in the left or middle pane, select the File
  3560. Extensions command and type in the file extension (eg “Notes”) that
  3561. you choose for your note files—see the “Custom file extensions” section
  3562. in the “Projects” chapter for an example. Which pane these files go
  3563. in (left or middle) is up to you. Using a custom extension rather than
  3564. the default “.c” or “.h” for your note files will also help prevent
  3565. confusion if other people examine your work.
  3566.  
  3567. Now add the note files to your project, select Update Dictionary, and
  3568. you can retrieve any note to the AutoLook window by typing its name
  3569. in any text window, and pressing <Enter> will place the note in a
  3570. separate new lookup window. If the name of the note consists of the
  3571. exact topic followed by “Note” then it will be easy to remember. And
  3572. if you place a comment in your source code containing the name of the
  3573. note, such as     /* see modDateNote */ 
  3574.  
  3575. then all you have to do is double-click on the note name (and press
  3576. <Enter> if you want a more permanent view than the one shown in the
  3577. AutoLook window).
  3578.  
  3579. A note can be of any length, and if you edit it heavily you can
  3580. probably clean up the appearance afterwards with Reformat Selection.
  3581.  
  3582. For an example of a note file, see the file “hAWK_notes.h” on disk 2.
  3583. As a specific example,
  3584.     if ((**availRgn).rgnSize > 10) /* see RegionNote */
  3585.         {
  3586.         yPos = 5;
  3587.         y = *(((int *)(*availRgn)) + yPos);
  3588.         while (y != 32767)
  3589.             {
  3590.             xPos = yPos + 1;
  3591.             ...etc
  3592. might look like Greek to me if I come back to review it, but by
  3593. clicking to the right of RegionNote  in the comment and pressing
  3594. <Enter> I can view my hard–won note on regions that explains in detail
  3595. what’s going on:
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614. Often it’s simpler to just place a “go to” link in your code
  3615. (consisting of a file name followed by a marker name, as detailed in
  3616. the “‘Go’ commands” chapter). “Go to” links have two advantages over
  3617. popup notes: any text in any document, including support documents,
  3618. can be marked for use a link, and the text at the link can include
  3619. illustrations. But “popup” notes as described above have two advantages
  3620. over “go to” links: they appear in politely placed and sized windows,
  3621. as do all lookup windows, and you can view several notes from the same
  3622. file in separate windows. A mix of “Go to” links to access existing
  3623. or complex documents, and popup notes to retrieve details on specific
  3624. programming tasks might be best.
  3625.  
  3626. §    EnterAct as a "definition finder" for other editors
  3627. To use EnterAct as a "definition finder" with other editors:
  3628. •    read enough here to learn how to create a project, build
  3629.     a dictionary, and show the "AutoLook" window. Knowing
  3630.     how to call up "lookup" windows by pressing the <Enter>
  3631.     key is also useful.  That's all above here.
  3632. •    when you're using the other editor, also run an EnterAct
  3633.     project with contents roughly corresponding to the code
  3634.     you're working on - have the "AutoLook" window open,
  3635.     as the frontmost text window in EnterAct. Your project
  3636.     dictionary should be reasonably up to date.
  3637. •    to look up a term with EnterAct; Copy it in the other editor,
  3638.     and switch to EnterAct. If you don't immediately see the
  3639.     definition in the AutoLook window (rare), press
  3640.     <Command><Enter>. To look up the class or struct that
  3641.     contains a particular member, press <Shift><Command><Enter>.
  3642.  
  3643. §    Looking it up with THINK Reference or Toolbox Assistant
  3644. You'll see "Find in THINK Reference" and "Find in Toolbox Assistant"
  3645. under EnterAct's Search menu: to get them working, create a folder
  3646. named "Tools" or "(Tools)" next to EnterAct at the same level, and
  3647. drop aliases of THINK Reference and QuickView into it. When you
  3648. want to look something up, either select a term or click just after
  3649. it and issue the appropriate menu command (the command key
  3650. equivalents <Command><-> and <Command><4> are worth memorizing).
  3651.  
  3652.  
  3653. -    -    -    -    -    -    -    -    -    -    -    -
  3654. Seeing where a term is defined
  3655. -    -    -    -    -    -    -    -    -    -    -    -
  3656. §    <Option>double–click
  3657. To see the file in which any dictionary term is defined, hold down the
  3658. <Option> key while double–clicking on the term. EnterAct will enter
  3659. the term in the Find dialog (the equivalent of Enter Selection), open
  3660. the file where the term is defined, and scroll to the first instance
  3661. of the term in the file.
  3662.  
  3663. Except for functions, methods, structs, classes, unions, and enums,
  3664. for which you’ll almost always be scrolled to the exact defining
  3665. instance, with no tripping over a mention in a comment or variable
  3666. declaration or prototype.
  3667.  
  3668. (Note you can look up the definition of a full method name, in the
  3669. format "class_name::method_name", by <Option>double-clicking
  3670. on the class name, dragging over to the method name to select it
  3671. as well, and then releasing the mouse. Or if you prefer you can
  3672. look it up by selecting both names and then using the Find
  3673. Definition command.)
  3674.  
  3675. Here's an example of looking up a class definition:
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704. If you are viewing just a method name, without the class name:
  3705. •    bring up your AutoLook window (you'll find it's useful all the
  3706.     time)
  3707. •    click after or double-click on the method name in your source
  3708.     window
  3709. •    AutoLook will show a complete list of prototypes for the method
  3710.     name
  3711. •    select the one you want, class name and method name inclusive,
  3712.     in the AutoLook window and use Find Definition
  3713. •    or <Option>double-click on the class name, drag to the method
  3714.     name, and release the mouse
  3715.  
  3716. For example, to view the definition of "DoSpecificCommand" in
  3717. the class "TFaxPage", when viewing just
  3718. "someObject->DoSpecificCommand(1,2)", you would click just
  3719. after "DoSpecificCommand" to see the following in the
  3720. AutoLook window:
  3721.     OSErr TFaxDocument :: DoSpecificCommand
  3722.         (short     stdCommandNumber,
  3723.         long    misc)
  3724.         
  3725.     OSErr TFaxEdit :: DoSpecificCommand
  3726.         (short     stdCommandNumber,
  3727.         long    misc)
  3728.         
  3729.     OSErr TFaxPage :: DoSpecificCommand
  3730.         (short     stdCommandNumber,
  3731.         long     misc)
  3732. --then select "TFaxPage :: DoSpecificCommand", and use the
  3733. Find Definition command to jump to the definition. Or <Option>
  3734. double-click on one of the words, drag to the other, and release
  3735. the mouse.
  3736.  
  3737. If your spelling of the method name is off, and nothing shows in the
  3738. AutoLook window, click just after your guess at the name and press
  3739. <Enter>. If your guess was close enough, the resulting lookup window
  3740. will hold entries for all methods with the correct name. Hold down
  3741. the <Option> key and click in the title bar of the lookup window to
  3742. view a list of the methods -- if you see the right one, select it,
  3743. and your desired one will appear in the body of the lookup window,
  3744. where you can <Option>double-click or use Find Definition.
  3745.  
  3746. §    Find Definition
  3747. Find Definition is useful with parts of a word (such as just the
  3748. WindowData  part of WindowDataPtr )—just select the exact term you want
  3749. to view the defining instance of, without regard for what comes before
  3750. or after it.
  3751.  
  3752. Find Definition ignores trailing spaces or tabs, and also accepts hint
  3753. characters in much the way that lookup does—see just below.
  3754.  
  3755.  
  3756. §    If there are multiple definitions
  3757. If you have several methods with the same name, use the
  3758. AutoLook window to pick the right one as described just above.
  3759.  
  3760. In the general case, you can jump to a particular definition of a
  3761. term as follows:
  3762. •    select the term or click after it, and press <Enter> to look it up
  3763. •    in the resulting lookup window, hold down the <Option> key and
  3764. click in the window's title bar to view a popup menu listing all the
  3765. definitions and abbreviated full path names for their locations
  3766. •    pick the one you want, then <Option>double-click on the term
  3767. as shown in the lookup window.
  3768.  
  3769. If the term is a static function or variable and you happen to be
  3770. viewing the file where it is defined, then <Option>double-clicking
  3771. on the name anywhere in that file will take you to the definition
  3772. in that same file.
  3773.  
  3774. Note if you want a list of all definitions of a term, the simplest
  3775. way is still to do a batch Find, then trim the results.
  3776.  
  3777. §    Other ways of finding definitions
  3778. The AutoLook window will display definitions instantly when you select
  3779. or click after a term, greatly reducing the need to “find” definitions.
  3780. It will also show most class method definitions, and definitions for
  3781. data members (these details are subject to last-minute improvements,
  3782. and by the way it may take a couple of seconds even on a fast machine
  3783. for a data member's class definition to show up in the AutoLook window
  3784. --if you're after the owning class for a member, take a break for a
  3785. few seconds to see if anything shows up in the AutoLook window,
  3786. since it won't go looking if you keep working).
  3787. And of course you can retrieve the definition of a term to a separate
  3788. lookup window by clicking after the term and pressing the <Enter> key.
  3789.  
  3790. “Go to” links, as explained in the “‘Go’ command” chapter, can be used
  3791. to jump to any marked location in any file. This includes function and
  3792. method definitions  if you are using Automark to mark your source files
  3793. in the default way.
  3794.  
  3795. The "Cross-Reference" index command (chapter 22) can generate a
  3796. cross-reference of C terms in your source code that is compatible
  3797. with EnterAct’s "Go to" command. These “file-name line-number”
  3798. references can go out of date if you edit your files, but are handy
  3799. for files that don’t change often.
  3800.  
  3801. -    -    -    -    -    -    -    -    -    -    -    -
  3802. Browsing
  3803. -    -    -    -    -    -    -    -    -    -    -    -
  3804. §    The Browse command
  3805. The window produced by this command shows a “family tree” of the
  3806. classes in your project, as of your last dictionary update, and also
  3807. allows you to quickly view any class or method definition. It will
  3808. close when you close your project, and will update automatically when
  3809. you update your project dictionary.
  3810.  
  3811. The solid black horizontal and vertical lines connect each child to
  3812. the first of its parents. If a class inherits from multiple parents,
  3813. light colored lines connect the middle of each parent to the left or
  3814. right end of each child. For example, given
  3815.     class A : B, C, D {...
  3816. you would find in the browser window a set of solid horizontal and
  3817. vertical lines connecting A to B, and light colored lines would connect
  3818. the middles of C and D to the left or right end of A.
  3819.  
  3820. If a class contains other classes or structs as members, they will
  3821. be listed beneath the class name, separated from it by a white line.
  3822.  
  3823. To view the definition of a class, double–click on the class name. This
  3824. works much like <Option>double-click or Find Definition in a text
  3825. window. This works with both a "main" class name and any of its
  3826. member class or struct names.
  3827.  
  3828. To view a method definition, click and hold on the owning class name:
  3829. after a brief pause (your double–click time, actually) a popup menu
  3830. will appear listing all of the class’s methods. You should then select
  3831. the method you want and release the mouse button, as if you hadn’t
  3832. guessed. This also works with member class names (as of this
  3833. writing, it's untested with member struct names.)
  3834.  
  3835. To view a popup of all methods in a class AND all methods that
  3836. it inherits, hold down the <Command> key and click and hold on
  3837. the class name. This list can be quite long, and may take several
  3838. seconds to generate--please be patient the first few times you
  3839. try it.
  3840.  
  3841. If your family tree of classes involves a great deal of multiple
  3842. inheritance, the many light colored lines may become too tangled to
  3843. decipher, and even obscure class names. To display just the colored
  3844. inheritance lines for one class, click once on the class name (all
  3845. colored lines not connecting to the class will disappear). To add
  3846. lines for other classes, click on the class names with the <Shift>
  3847. key held down. Similarly, you can suppress the colored lines for one
  3848. class by <Shift>clicking on it. To show all colored lines again, click
  3849. once on the white background between classes. Double-clicking to
  3850. show a class definition does not suppress any colored lines, and neither
  3851. does the click-and-hold to view a method popup.
  3852.  
  3853. Instead of trying to follow the colored lines, you can view the parents
  3854. of a main class by holding down the <Option> key and
  3855. clicking on its name to view a popup of mom and pop etc. Note that
  3856. releasing the mouse over one of the parents will take you to its
  3857. definition, a feature I included mainly because a popu is supposed
  3858. to do something.
  3859.  
  3860. Classes without proper parents (orphans, if you like) will always
  3861. appear in the left–most column of your browser window. A quick look
  3862. down the left column will reveal whether you have any unintentional
  3863. orphans, perhaps due to misspelling the parent class name in the class
  3864. definition. 
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885. (Note EnterAct works fine with CodeWarrior etc classes, for which
  3886. there may be many base classes in the leftmost column.)
  3887.  
  3888. §    Finding classes in the Browser window
  3889. To bring a particular class into view, type the first part or some
  3890. distinctive part of its name. The name will flash once.
  3891.  
  3892. §    Method and class popups
  3893. (This is a summary of popups, as described above)
  3894. • to view the methods associated with a class, click and hold
  3895. on the class name.
  3896. • to view all inherited methods as well, hold down the <Command>
  3897. key while you click and hold on the class name. If the list is
  3898. gigantic, it may take several seconds to generate the popup, so
  3899. please be patient the first few times you try this.
  3900. • to view a list of the immediate parents of a class, hold down
  3901. the <Option> key while you click and hold on the class name.
  3902.  
  3903. §    Browsing classes without the browser
  3904. Nothing new to seeing class definitions—click to the right of the class
  3905. name and press <Enter>, or just look in the AutoLook window.
  3906. You will typically find the class name of an object as the first name
  3907. in the statement where it is defined, as in
  3908.     TClassName        *objectName;
  3909. You can also, of course, look up a class by typing the name and
  3910. pressing <Enter>, and in all cases your spelling just needs to be
  3911. reasonably close, not exact. In either case, the definition will appear
  3912. in the AutoLook window if you have it open.
  3913.  
  3914. To view the definition of a class when looking at one of the class
  3915. methods, see the section below.
  3916.  
  3917.  
  3918. §    Browsing methods without the browser
  3919. (The approach below is for use when your spelling of a method
  3920. name is incorrect. If your spelling is correct, you will see
  3921. the appropriate prototype in the AutoLook window when you
  3922. click after or double-click on the method name. To go to the
  3923. definition, select the full "class_name::method_name" in the
  3924. AutoLook window, then use the Find Definition command, or
  3925. <Option>double-click, dragging to select both names before
  3926. releasing the mouse.)
  3927.  
  3928. Method browsing is a bit trickier, since if you have something like
  3929.     currentObject->Draw();
  3930. and there are several different classes with Draw() methods, then
  3931. EnterAct does not know specifically which Draw() method you want. If
  3932. there is only one method in your project with a given name, then the
  3933. lookup window will contain just one entry, but if there are several
  3934. then the lookup window will contain all of them (up to a maximum of
  3935. 60). For example, if you were to press <Enter> with an insertion point
  3936. to the right of Draw above, then the lookup window might contain
  3937. entries for void Circle::Draw(), void Square:: Draw(), void
  3938. Oval::Draw() and so on. When there are several entries like this, you
  3939. can cycle through them by pressing the <Enter> key, and back up by
  3940. pressing <Option><Enter>. There are some illustrations of this just
  3941. ahead.
  3942.  
  3943. This raises the question of how to find where a method is defined. The
  3944. general approach is described in the chapter “Seeing where a term is
  3945. defined”, but the approach for a method has one extra step:
  3946. •    click after the method name, and a list of all methods with that
  3947.     name will appear in the AutoLook window;
  3948.     or, press <Enter> and cycle through the lookup window until
  3949.     you find the method you want, based on the name of the owning class
  3950. •    then select the entire name, consisting of the owning class name,
  3951.     the two colons, and the method name, in general
  3952.         className::methodName
  3953. •    and then select Find Definition.
  3954. •    (or <Option>double-click, ya ya you know already)
  3955. There is one exception to this: if there is only one method in your
  3956. project with the name in question, then a standard <Option>
  3957. double–click on just the method name will jump you to the file where
  3958. that method is defined. However, if there are several methods with the
  3959. same name  in different classes, there’s no predicting which definition
  3960. you will see if you just <Option> double–click on the method name—best
  3961. to look up the method first, and use Find Definition on the full name
  3962. of the exact one you want.
  3963.  
  3964. By the way, when viewing the full “className:: methodName” of a method,
  3965. you can look up the definition of the owning class of the method by
  3966. clicking at the right end of the class name, before the colons, and
  3967. pressing <Enter>. If the instance of the method name you’re viewing
  3968. doesn’t have the class name attached, look up the method name as
  3969. decribed just above to see the full method name including the owning
  3970. class, and then do your lookup for the class in the lookup window shown
  3971. for the method.
  3972.  
  3973. If you want to see where a method is defined, but can’t remember the
  3974. exact spelling of the name, type your best guess and press <Enter>.
  3975. The true name you wanted will probably be among the first few entries
  3976. in the lookup window, and then you can proceed with an <Option>
  3977. double–click or Find Definition right in the lookup window to get to
  3978. the file you want to see.
  3979.  
  3980. If you want lookup for a method when you’re not sure of the spelling,
  3981. and want to restrict the lookup to just methods, type a bit of the
  3982. class name and two colons just before the method name—even C::method
  3983. will do (even if the class name doesn’t contain a “C”—it’s the two
  3984. colons which signal that a method is wanted).
  3985.  
  3986. EnterAct is not a fancy bells–and–whistles browser, but it does allow
  3987. you to look everything up quickly. And, it has two advantages over any
  3988. other browser: your code doesn’t have to be perfectly compilable, just
  3989. reasonably close; and your spelling when you want lookup for anything
  3990. (including methods and classes) doesn’t have to be perfect, just close
  3991. enough to be distinctive. Try that on your SmallTalk!
  3992.  
  3993.  
  3994. A method-browsing example:
  3995. (The approach below is for use only if your spelling of
  3996. the method name is incorrect: if your spelling is correct, click
  3997. after the method name, then use Find Definition on the full
  3998. class name::method name right in the AutoLook window.)
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009. Press <Enter> with cursor to the right of "DoCommand” to see...
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017. press <Enter> again to see the second entry...
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025. To view the definition of "CArtClassApp::DoCommand", select it...
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033. and then select Find Definition, or <Option>double-click:
  4034.  
  4035.  
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  4045. -    -    -    -    -    -    -    -    -    -    -    -
  4046. Documents and windows
  4047. -    -    -    -    -    -    -    -    -    -    -    -
  4048. §    New, Open, Close
  4049. New under the File menu means a new text window. To create a project,
  4050. select New Project from the EnterAct menu. A new lookup window appears
  4051. automatically whenever you look something up. New PICT windows can’t
  4052. be had, no matter what you try.
  4053.  
  4054. Open under the file menu allows you to open any TEXT or PICT document.
  4055. To open a project, select Open Project from the EnterAct menu. 
  4056.  
  4057. Close will close the front window, whatever it is, and the key
  4058. equivalent <Command><W> is often handy. Close Project will close the
  4059. project window whether it is in front or not. Only one project can be
  4060. open at a time, so if you select Open Project while a project is open
  4061. you will be asked to confirm putting away the current project. The same
  4062. applies if you select New Project.
  4063.  
  4064. To close all text windows, select Close All from the Windows menu. This
  4065. will not close your project or the Find dialog.
  4066.  
  4067.  
  4068. §    Save, Save As, Revert
  4069. Save applies only to proper text documents (not lookup windows) and
  4070. to PICT’s. Saving a PICT will alter only the window location that
  4071. EnterAct saves with any file. To save the contents of a lookup window,
  4072. Copy what you want and Paste it into a regular text window. Projects
  4073. are saved automatically, when you update the dictionary, add files,
  4074. or close the project. 
  4075.  
  4076. Save As can be used with text and PICT documents, and with a project
  4077. as well. In particular, you can set up a project to use as
  4078. “stationery”, with the font and window location preset, and commonly
  4079. needed files already added—for details see the “Projects” chapter,
  4080. section “Creating a project”.
  4081.  
  4082. Revert applies to text and PICT documents only (with PICT’s only the
  4083. position on your screen is reverted).
  4084.  
  4085. §    Close and Save Documents
  4086. These two new commands are under the Windows menu, supplementing
  4087. the old Close All and Save All. The Close Documents and Save
  4088. Documents commands affect only windows which already have a
  4089. corresponding file on disk: in particular, “untitled” windows are left
  4090. alone. By contrast, Close All also closes lookup windows and asks you
  4091. to save any “untitled” windows—and Save All also asks you about
  4092. saving “untitled” windows.
  4093.  
  4094. §    Autorevert
  4095. When you select Autorevert for an open document, EnterAct will check
  4096. the disk file for the document every 10 seconds, and refresh the
  4097. document’s window if the contents of the file have changed. This
  4098. continues until you select Autorevert for the document again (it’s a
  4099. toggle) or until you close the window. To remind you that the
  4100. document’s window is being autoreverted, a “disk-to-window” icon will
  4101. be shown in the window’s display box.
  4102.  
  4103.  
  4104.  
  4105.  
  4106.  
  4107. Typically EnterAct will not detect that a file has been changed until
  4108. it is closed by the program that is changing it.
  4109.  
  4110. While implemented in a general way, Autorevert is primarily meant for
  4111. use with hAWK programs that print ongoing progress messages to disk.
  4112. Several of the supplied hAWK programs print messages to the file
  4113. “$tempProgress”, and by monitoring this file via Autorevert you can
  4114. watch how programs are progressing as they run. For more on this use
  4115. of Autorevert see Appendix 2.
  4116.  
  4117. Every decent app needs one nutty gizmo. Hence Autorevert.
  4118.  
  4119. §    Modify Read Only
  4120. EnterAct watches out for Projector 'ckid' resources, and won't let you
  4121. change a file if it has been checked out of SourceServer as
  4122. "read only". When a document can't be changed for this reason, a small
  4123. pencil with a slash through it will be shown in the display box of
  4124. its window.
  4125.  
  4126. When you need to edit a file that has been checked out as "read only",
  4127. select "Modify Read Only" from the File menu. This makes the file
  4128. fully editable, and alters the 'ckid' resource slightly so that
  4129. SourceServer will know the file has been changed when you check
  4130. it back in. "Editable" meaning you can change the text in the window
  4131. and save the changes, just as with a regular document.
  4132.  
  4133. No icon is displayed for "modifiable read only" files, mainly because
  4134. your author can't figure out what the heck that means. Whatever
  4135. else it does, it severely compromises version control.
  4136.  
  4137.  
  4138. §    Saving window locations
  4139. Saving window locations is nice, provided you aren’t pestered all the
  4140. time to save your changed location when you close a window. In
  4141. EnterAct, saving window locations takes the place of neatly tiling and
  4142. stacking windows. By default, EnterAct will save window locations
  4143. whenever you save a text or PICT document. If you would rather not have
  4144. window locations saved, call up the Options dialog and uncheck the
  4145. “Save document window locations” item. Any saved locations will also
  4146. be ignored when a document is opened if you uncheck this item.
  4147.  
  4148.  
  4149. §    ... without being pestered
  4150. Beneath the “Save document window locations” item in the Options dialog
  4151. there’s another check box, “...but don’t pester me about saving
  4152. locations”. Both of these options are on by default. The “don’t pester”
  4153. part means that you will not be asked if you wish to save a text window
  4154. when you close it if all you’ve done is change the window’s location
  4155. on the screen. 
  4156.  
  4157. The location of the project window is always saved (this is automatic)
  4158. regardless of your options.
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180. §    Newly opened windows can be long or short
  4181. If the “Save document window locations” item in the Options dialog has
  4182. a check mark, and if a document you open has a window location saved
  4183. with it, then EnterAct will restore your document to its saved
  4184. location. Otherwise, EnterAct won’t have a remembered location for the
  4185. window, or will ignore it (this is especially true of a new text
  4186. window). You can roughly control the length of these windows with the
  4187. radio button options “Windows open short / long by default” in the
  4188. Options dialog. Long windows will reach all the way to the bottom of
  4189. your main screen when they open. Short windows will indeed be
  4190. relatively short on a large screen, but will fill most of a small
  4191. screen.
  4192.  
  4193. The default is short windows. Note that you can grow just the length
  4194. of any text window down to the bottom of the screen by holding down
  4195. the <Option> key while clicking in the zoom box.
  4196.  
  4197. The default width of a new window is fixed at a moderate size, about
  4198. 74 characters in Monaco 9 (this is also a near–maximum nice width for
  4199. printing). For existing documents, the width will be based on the first
  4200. 20 lines of the text, within reasonable limits.
  4201.  
  4202. Note that if a document is being opened during restoration of a
  4203. project’s context its location will be where you last left it, not
  4204. necessarily the same as where you last saved it.
  4205.  
  4206.  
  4207. §    <Option>–Zoom zooms just the length
  4208. If you hold down the <Option> key while clicking in the zoom box of
  4209. a window, only the length will be affected. If you’re zooming out (the
  4210. first zoom is usually an “out”), the bottom of the window will drop
  4211. down to the bottom of your screen, rather in the way a menu drops down.
  4212. Zooming in is not affected by the <Option> key. 
  4213.  
  4214. The window you're zooming will stop short of covering your AutoLook
  4215. window if it's in the way.
  4216.  
  4217.  
  4218. §    Number of windows at one time
  4219. Restrictions on the maximum number of windows on–screen at one time
  4220. are as follows:
  4221. regular text, PICT    memory-limited
  4222. lookup                        10 or fewer (see below)
  4223. project, Browser, AutoLook, Find - one of each at a time.
  4224.  
  4225. Note you can print any number of EnterAct  text files by selecting them
  4226. in the Finder and then selecting the Finder’s print command, since the
  4227. files will be opened, printed, and closed one at a time.
  4228.  
  4229. While the hard upper limit on lookup windows is 10, you can set the
  4230. maximum number on–screen to any number between 1 and 10 using the
  4231. Options dialog. The default number is 4.
  4232.  
  4233.  
  4234. §    The Windows menu
  4235. Consisting of: Close All, Close Documents, Save All, Save Documents,
  4236. Keep Lookup Around, and a list of your open windows, with the project
  4237. first and others in order from front to back on your screen.
  4238.  
  4239. Close All affects text, lookup, and PICT windows. If it needs saving,
  4240. you’ll be asked. Lookup windows will be quietly closed, since they
  4241. cannot be saved. The combination of Close All with remembered window
  4242. locations lets you arrange groups of documents to work with at one
  4243. time, and switch between groups with a minimum of nuisance.
  4244.  
  4245. Save All will save any text or PICT documents that need it (note lookup
  4246. windows aren’t saveable). If a text window hasn’t been saved yet,
  4247. you’ll see the standard Save As dialog. If you use MultiFinder or
  4248. System 7, and you decide to switch off the “Safe switching under
  4249. MultiFinder” option in the Options dialog, I would strongly recommend
  4250. that you use Save All or preferably Close All before switching to
  4251. another application.
  4252.  
  4253. Close Documents and Save Documents do the same as the Close and
  4254. Save All versions, but affect only documents, ie windows that
  4255. correspond to an existing disk file.
  4256.  
  4257. Keep Lookup Around applies only to lookup windows. The maximum number
  4258. of lookup windows on–screen is fixed (although you can change this
  4259. number at any time in the Options dialog), and when this limit is
  4260. reached the next lookup window that you call up will quietly close one
  4261. of the old lookup windows to make room. To avoid having a particular
  4262. lookup window disappear later on you, select Keep Lookup Around when
  4263. the lookup window is in front. The two bullets •• at the beginning of
  4264. the lookup window’s title will change to ¶¶, showing that it won’t go
  4265. away until you yourself close it. Note especially that Close All will
  4266. close all lookup windows, whether or not they are marked for keeping.
  4267.  
  4268. To bring a window to the front, select it by name from the lower part
  4269. of the Windows menu. If a project is open, it can always be brought
  4270. to the front with the menu key–equivalent <Command><zero>, which is
  4271. worth memorising. No other windows (except dialogs) have key
  4272. equivalents—if your memory is that good then in my humble opinion you
  4273. don’t need EnterAct in the first place. 
  4274.  
  4275.  
  4276. §    The display box
  4277. All text windows including lookup windows have a small “display box”
  4278. along the bottom in the horizontal scroll bar area. For a regular text
  4279. file this displays the name of the file; in a lookup window it shows
  4280. the name of the file from which the entry was taken, followed by the
  4281. (abbreviated) type of entry, the number of the current entry shown,
  4282. and the total number of entries available in the lookup window.
  4283.  
  4284. When you drag the mouse to select text in a text window, the display
  4285. box will change to show the line number that the mouse is currently
  4286. on, followed by the number of characters selected. If more  than one
  4287. line is selected, the display box will show the number of lines
  4288. selected rather than the current line number. To determine how many
  4289. lines there are in a file, use <Option><down arrow> or Go Bottom and
  4290. click on the last line of the file. To determine the number of
  4291. characters in a file, click at one end of the file and then
  4292. <Shift>click at the other end of the file.
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304. (the display box is now on the left, otherwise unchanged)
  4305.  
  4306. §    Printing
  4307. To print a text file, bring its window to the front and select Print.
  4308. A Page Setup beforehand will be needed if you wish to print in a
  4309. nonstandard way, such as sideways or with an unusual paper size. To
  4310. stop a printout, press <Command><period>.
  4311.  
  4312. Printing of PICT’s or other kinds of files is not supported, just text.
  4313. However, any illustrations in a text document (see next section) will
  4314. print properly, with automatic nudging to avoid clipping a picture off
  4315. at the bottom of a page.
  4316.  
  4317.  EnterAct does not clip long lines of text, but folds the “hangover”
  4318.  back to the left margin on a new line. The line-break is not always
  4319.  as good as you yourself would do it, but at least you will never lose
  4320.  any characters off the right edge when printing. 
  4321.  
  4322. §    Illustrating your text
  4323. As you can see from this manual, there is a way to put PICT's in a
  4324. text document. You can place dialog and screen snapshots,
  4325. structure mockups, flowcharts, state machines, in short, any old
  4326. PICT, into your spec, design, and test documents, even into your
  4327. code files (EnterAct’s style of illustration goes unnoticed by
  4328. compilers, provided you place the picture inside a comment).
  4329. However, the process of placing an illustration is not at present a
  4330. simple one, nor is the order of pictures in a document easily changed,
  4331. so it would be best to reserve illustrations in your documents for
  4332. those occasions when an immediate view of a picture truly is worth a
  4333. thousand words.
  4334.  
  4335. Illustrations come in two parts: PICT resources, placed in the resource
  4336. fork of your document using ResEdit or equivalent; and “picture
  4337. markers” in the text of your document, each consisting of a <Return>
  4338. followed immediately by an <Option><space>.
  4339.  
  4340. If you have more than one illustration in a document, the PICT’s should
  4341. be given ID numbers in the same sequence as they are to appear in your
  4342. document. The numbers should be between 128 and 32,767, and if you
  4343. anticipate coming back later to insert new pictures between old ones
  4344. you should space the numbers out a bit, using for example the sequence
  4345. 2,000, 2,100, 2,200.... All PICT’s should be made purgeable, as
  4346. EnterAct does not insist on keeping the PICT’s in memory. In ResEdit,
  4347. you can mark the PICT as purgeable at the same time as you set the ID
  4348. number, using “Get Info...” with the PICT selected.
  4349.  
  4350. For each PICT you wish displayed, you’ll need a <Return>  
  4351. <Option><space> pair at the position where you wish the illustration
  4352. to appear. The simplest approach is to first use ResEdit to install
  4353. your PICT’s in the document, then open the document using EnterAct and
  4354. insert an <Option><space> at the beginning of the line where you want
  4355. the first picture to appear. As you type the <Option><space>, the
  4356. picture will begin to appear—you should then type enough <Return>’s
  4357. to open up blank lines for the picture to occupy, so that it doesn’t
  4358. overlap any following text (however, you may certainly overlap picture
  4359. and text if you want). If you need to see the picture fully redrawn
  4360. while doing this, click in the up or down arrow of the vertical scroll
  4361. bar. Repeat for any following pictures.
  4362.  
  4363. To sum up, the PICT’s in the resource fork of your document should have
  4364. ID numbers that are in the same order as you want them displayed; for
  4365. each picture there should be a <Return> <Option><space> followed by
  4366. enough blank lines to make room for the picture.
  4367.  
  4368. To insert a PICT between two existing PICT’s, give it an ID number
  4369. between the numbers for the flanking PICT’s when you paste it in with
  4370. ResEdit, and put the “picture marker” of course between the flanking
  4371. markers.
  4372.  
  4373. If your pictures end up displayed in the wrong order, you can be sure
  4374. that their ID numbers are not in the correct order. A missing picture
  4375. means that either the PICT or the <Return> <Option><space> for it is
  4376. missing. A picture can be moved around between two flanking pictures
  4377. just by cutting and pasting the picture marker, but to change the order
  4378. of pictures you will have to change the PICT ID numbers to the sequence
  4379. you want. Excess PICT’s won’t be displayed until you enter a picture
  4380. marker, and excess markers don’t hurt, but may be triggered
  4381. unexpectedly if you add a PICT at the end of your file.
  4382.  
  4383. A file with two PICT illustrations that have been pasted in
  4384. using ResEdit:
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400. The "Activities" PICT in "EnterAct Log": the small black rectangle is
  4401. the <Option><space> that marks the picture insert position (shown
  4402. selected). Several <Return>'s follow, to open up enough room for the
  4403. picture.
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421. For a whopping big example, examine this document and its resources.
  4422.  
  4423. -    -    -    -    -    -    -    -    -    -    -    -
  4424. Editing
  4425. -    -    -    -    -    -    -    -    -    -    -    -
  4426. §    Introduction
  4427. EnterAct provides all the standard text editing commands, which should
  4428. be familiar from elsewhere (THINK C, for example), and so the emphasis
  4429. in this chapter will be on EnterAct’s editing enhancements. Briefly,
  4430. they are:
  4431.     •    everything that changes a document is undoable one way or another,
  4432.         except Revert. In addition to the usual Undo/Redo under the Edit menu,
  4433.         you can also undo any one of your most-recent thousand activities, and
  4434.          limited file reversion is also available (see the “Show Activities”
  4435.         chapter)
  4436.     •    Paste Selection Behind combines Copy, switch to the next window,
  4437.         and Paste in one command
  4438.     •    the indentation of your code will commonly be preserved when you
  4439.         Paste or Paste Selection Behind
  4440.     •    the selection in the next–to–front window is shown in a frame,
  4441.         useful with the Paste Selection Behind and Find commands
  4442.     •    Reformat Selection can “pretty up” a comment or selection of text,
  4443.         rebreaking lines to your specified width.
  4444.     •    Syntax coloring, for line comments, strings, and ticks
  4445.     •    Graphic nesting display
  4446. “Balance”, “Show Activities”, and “Options”, under the Edit menu, are
  4447. described in their own separate chapters later in this manual.
  4448.  
  4449.  
  4450. §    Undo
  4451. EnterAct has one level of undo and redo, via Undo/Redo under the Edit
  4452. menu. The undoable and redoable actions are: typing, Cut, Copy, Paste,
  4453. Paste Selection Behind, Clear (Backspace), Shift Left, Shift Right,
  4454. Reformat Selection, Replace, Replace and Find Again, and Replace All.
  4455.  
  4456. Revert is not undoable, though discarded changes can often be recovered
  4457. with Show Activities. All other “undoable” changes (such as changing
  4458. the font) can be undone by reusing the same command (such as changing
  4459. the font back).
  4460.  
  4461. Just clicking the mouse or selecting a range of text does not affect
  4462. undo. Changing the window does make the last change temporarily
  4463. undoable, but you can restore the ability to undo the last change by
  4464. bringing the appropriate window to the front again.
  4465.  
  4466. To selectively undo past activities or revert files back past the last
  4467. saved version, see the “Show Activities” chapter. For these purposes,
  4468. EnterAct records your last 10,240 activities in full to disk.
  4469.  
  4470.  
  4471. §    Typing, Cut, Copy, Clear
  4472. “Typing” means hitting a sequence of keys that produces text,
  4473. intermingled with any number of <Backspace>’s. A new typing operation
  4474. begins whenever you change the insertion point or select characters
  4475. and then type something. As with all actions, just changing the
  4476. insertion point or selecting characters does not affect your ability
  4477. to undo—it’s the subsequent change to your text that does it.
  4478.  
  4479. When you type <Return> the resulting new line will have the same
  4480. indentation as the line above it, unless you hold down the <Option>
  4481. key, in which case you’ll end up flush at the left margin.
  4482.  
  4483. Cut and Copy are as you would expect, but there is one special feature:
  4484. if you want to take a screen-shot in EnterAct, first Copy a single
  4485. character, and then immediately after taking the screen-shot paste it
  4486. into your scrapbook.
  4487.  
  4488. As an aside, please see "EnterAct's magic clipboard" for a way to run
  4489. hAWK programs on whatever you Copy with EnterAct. The basic 
  4490. sequence is: you write the hAWK program you need, and start it
  4491. running; and then whenever you need the program's results, Copy
  4492. some text to give it the appropriate input, and Paste the results.
  4493. Typically the menu bar will flash to show that your program has
  4494. done something with the current clipboard's contents (this and
  4495. all other aspects of the program are under your control). This
  4496. effectively gives you programmable Copy/Paste using what has
  4497. been called the best little language in the world, and some example
  4498. programs are provided to get you going.
  4499.  
  4500. "Clear" has the same effect as the <Clear> key, and <Backspace> is also
  4501. the equivalent of a Clear if a range of text is selected. If no text
  4502. is selected, <Backspace> will delete one character, whereas Clear will
  4503. not.
  4504.  
  4505.  
  4506. §    Paste preserves indentation
  4507. At least, it does if the range of text you select to be pasted over,
  4508. or the insertion point for the paste, satisfies the requirement: “all
  4509. tabs or spaces to the left at the start”. Also, the text must have been
  4510. cut or copied with EnterAct.
  4511.  
  4512. “All tabs or spaces to the left at the start” means that the first
  4513. character you select for replacement should be the first character on
  4514. the line that is not a space or tab. If you have just an insertion
  4515. point for the Paste, then the same applies—there should be nothing but
  4516. spaces and tabs from the insertion point to the left margin. Starting
  4517. at the left margin will also do.
  4518.  
  4519. The basic rule is you shouldn’t “see” any printing characters between
  4520. the left margin and the start of your selection or insertion point.
  4521. If this rule is satisfied when you are about to Paste, then the paste
  4522. will preserve your relative indentation, removing the need to Shift
  4523. Left or Shift Right afterwards.
  4524.  
  4525. About the only special action you should take to have Paste preserve
  4526. your indentation is to open up a new line with a <Return> just before
  4527. you paste in a block of code, which you probably do anyway.
  4528.  
  4529. Paste Selection Behind also preserves indentation.
  4530.  
  4531. §    Selection: front, next–to–front
  4532. EnterAct shows you what you have selected in the text window that is
  4533. just behind the front window. This helps you to make use of the
  4534. Paste Selection Behind command, and also shows you where you are
  4535. when the Find dialog is in front of your text window.
  4536.  
  4537. The selection in your front window is as white text in a black box.
  4538. EnterAct draws a black outline around the selection in your
  4539. next–to–front window so you can distinguish it from the front selection.
  4540.  
  4541. You’ll see the selection in your next–to–front window only when
  4542. something can be done with it (such as Paste Selection Behind, or
  4543. Replace). For an illustration, see just below.
  4544.  
  4545.  
  4546. §    Paste Selection Behind
  4547. Paste Selection Behind does the following three actions in one : Copy
  4548. what is selected in the front window; switch to the window just behind
  4549. it; and Paste the copy in over the selection in that window. You’ll
  4550. see your selection in the next–to–front window just beforehand, as
  4551. described above. If you can’t see what is selected in the next–to–front
  4552. window, you can either trust to memory (it’s undoable) or do a “manual”
  4553. Copy, switch windows, Paste.
  4554.  
  4555. Paste Selection Behind is especially handy when switching back and
  4556. forth between your working text window and a lookup window, but it can
  4557. be used with any two text windows.
  4558.  
  4559. Your indentation will be preserved with Paste Selection Behind under
  4560. the same circumstances that apply to a Paste (see “Paste preserves
  4561. indentation” above).
  4562.  
  4563. If you want to undo a Paste Selection Behind but have switched to a
  4564. different window, bring the two windows involved in the Paste Selection
  4565. Behind to the front alternately until Undo becomes enabled. The two
  4566. windows involved are the one you pasted into, and the one you copied
  4567. from.
  4568.  
  4569. (before Paste Selection Behind)
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585. (after Paste Selection Behind)
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601. §    Font, font size, tabs
  4602. Sizes for your font are restricted to sizes that are actually installed
  4603. in your system. The default font for text windows in EnterAct is Monaco
  4604. 9, with 4 spaces per tab.
  4605.  
  4606. You can also change the font for the project window. The default here
  4607. is also Monaco 9.
  4608.  
  4609. For projects only, holding down the <Option> key while changing
  4610. the font or size will give you a bold style.
  4611.  
  4612. Tabs in EnterAct are of the relative sort, meaning that when you press
  4613. <Tab> your insertion point advances to the next tab stop. Tab stops
  4614. are placed a fixed number of spaces apart, and you can change this
  4615. number with the Tabs dialog. Note that if you change the font it may
  4616. throw off your nicely–aligned code, so it’s best to pick one font for
  4617. code at the beginning of your programming career and stick with it.
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629. §    Shift Left / Right
  4630. Shift Left and Shift Right will shift one or more entire lines left
  4631. or right by a tab stop, allowing you to repair or alter the relative
  4632. indentation of your code or text. For simplicity, you should select
  4633. one or more entire lines before calling these commands. They are
  4634. undoable.
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645. (the effect of Shift Left on the above selection)
  4646.  
  4647.  
  4648.  
  4649.  
  4650.  
  4651.  
  4652.  
  4653.  
  4654.  
  4655.  
  4656.  
  4657.  
  4658. §    Reformat Selection
  4659. Reformat Selection will rebreak the lines in your selection, but the
  4660. result may not always be an improvement. It is designed to work with
  4661. multiple paragraphs, provided you don’t indent the beginning of the
  4662. first line, and that you separate paragraphs with a blank line.
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676. (the above after Reformat Selection, with the default settings)
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690. Reformat Selection doesn’t work well on C code, although it may on
  4691. occasion help to tidy up a complicated “if” statement. It works best
  4692. with one or more paragraphs of text, either an entire comment or part
  4693. of a comment, or paragraphs in a text document.
  4694.  
  4695. Since Reformat Selection is undoable there’s no harm in trying it. The
  4696. maximum selection that can be reformatted at one time is roughly the
  4697. standard Text Edit limit, 32,000 or so characters.
  4698.  
  4699. The specific reformatting that Reformat Selection does is governed by
  4700. two options in the Options dialog. The default action is to rebreak
  4701. lines with a “ragged right” format and a maximum line length of 74
  4702. characters, a nice width for printing Monaco 9. In the Options dialog
  4703. (near the bottom) you can alter the maximum number of characters per
  4704. line, and also select a “full justification” look if you want to knock
  4705. people over with your comments. The maximum number of characters per
  4706. line is restricted to a range of 30 to 150.
  4707.  
  4708. §    Syntax coloring
  4709. Color can be applied to comments, strings, and constants inside
  4710. ticks -- if you don’t like the default colors, there are a few
  4711. commands to change them, under the Edit menu.
  4712.  
  4713. This is a simple implementation of coloring, and it doesn't color
  4714. multiline strings properly. The goal here was to color only those
  4715. things that might usefully be colored, things that don’t immediately
  4716. catch the eye and yet are of some importance. Keywords are not
  4717. colored; if they don’t immediately catch your eye yet, just be
  4718. patient, with a bit more programming under your belt they will.
  4719.  
  4720. Syntax coloring might improve with future versions, but one thing
  4721. you can say about EnterAct’s coloring: it doesn't flicker!
  4722.  
  4723. If you grow bored with merely colored comments, try out the
  4724. "Comment options..." command under the Edit menu.
  4725.  
  4726. §    Graphic nesting display
  4727. Hold down the <Option> AND <Command> keys with a source file
  4728. frontmost and vertical lines will appear showing the scope of
  4729. each statement block (ie anything inside {} curly braces). It’s
  4730. OK to scroll with these keys down, but you should release them
  4731. before further editing (I think).
  4732.  
  4733. §    Arrow keys for moving around
  4734. The up down left right arrow keys will move your cursor by one
  4735. character or line. If you hold down the <Option> or <Command> key an
  4736. arrow key will take you all the way in the appropriate direction.
  4737. <Option><up arrow> and <Option><down arrow> are especially useful for
  4738. taking you to the top or bottom of your document.
  4739.  
  4740. (Here’s a glance ahead at the Show Activities command, which produces
  4741. a list of your recent activities for review or undo. The positions
  4742. shown, such as “«Cedar_MarksA.c 1411 3” below, are compatible with
  4743. EnterAct’s Go to command, and positions can be corrected for the
  4744. effects of other activities to give you a list that is as up to date
  4745. as possible. Within generous limits, you will be able to review,
  4746. recover, or undo anything you’ve done with EnterAct recently. Details
  4747. are in the “Show Activities” chapter.)
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  
  4765.  
  4766. -    -    -    -    -    -    -    -    -    -    -    -
  4767. Balance
  4768. -    -    -    -    -    -    -    -    -    -    -    -
  4769. NOTE you can also Balance a delimiter by double-clicking on it.
  4770.  
  4771. §    Checks everything
  4772. ...except those angular brackets that you find only in
  4773.         #include <SystemHeader.h>.
  4774. The full list is (), [], {}, /* */, " ", and ' '.
  4775. Balance will also detect nested comments and any single
  4776. improperly–formed comment start or end. Two improper comment delimiters
  4777. in a row (improper start followed by improper end, or vice versa) will
  4778. not be detected, but that’s a one–in–a–million case that you’ll
  4779. probably never see. 
  4780.  
  4781. Because Balance detects nested comments, it will signal an error if
  4782. you use a comment start or end within a comment (nested comment starts
  4783. are excepted if you deselect the “Detect nested comment starts” option
  4784. in the Options dialog)—see “Nested and bad comments” below. 
  4785.  
  4786. For strings in double quotes " ", the line continuation character '\'
  4787. must be the last character on the line if the string is continued to
  4788. the next line:
  4789.     "This string is \<Return>
  4790.     properly continued."
  4791.     "This string will trigger<Return>
  4792.     a Balance error."
  4793.     "So will \<space><Return>
  4794.     this string, due to the space before Return."
  4795.  
  4796. Balance will behave in different ways depending on where you are in
  4797. the code. To Balance an entire file, select an insertion point at the
  4798. very top of the file (<Option><up arrow> will take you there). To
  4799. Balance a specific delimiter, either click just to the left of it or
  4800. select the delimiter (note for comment starts and ends this means both
  4801. characters). 
  4802.  
  4803. Given an insertion point, Balance will first look to the immediate
  4804. right for a delimiter that wants balancing, and then to the immediate
  4805. left. When several delimiters are side by side, you can avoid having
  4806. to remember this by just selecting the delimiter you wish balanced.
  4807. Clicking between the characters of a comment start or end also counts
  4808. as a “hint” to find the other end. 
  4809.  
  4810. If your range of characters selected doesn’t consist of just a single
  4811. delimiter, or if your insertion point is not right next to a delimiter,
  4812. then Balance will try to find the smallest enclosing pair of
  4813. delimiters. Your selection range will expand to the next enclosing pair
  4814. as you repeat the Balance command.
  4815.  
  4816.  
  4817. §    Shows the error location
  4818. Any unmatched or mismatched delimiter will be selected and shown. In
  4819. the case of mismatched delimiters, you can switch between the two
  4820. delimiters by selecting Balance again. If the delimiter is an “orphan”,
  4821. the second Balance will just produce a beep, since there’s no other
  4822. end to show.
  4823.  
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830.  
  4831. (if there’s a mismatch, a second Balance will show the other end)
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839.  
  4840.  
  4841. §    Balancing a file
  4842. Given an insertion point at the top of a file, Balance will balance
  4843. the entire file. If you hear a beep and the cursor does not move from
  4844. the top of the file, that means the entire file is balanced. Either
  4845. Go Top or <Option><up arrow> will take you to the top of a file.
  4846.  
  4847. Balancing a file by starting from the top will always work correctly.
  4848. You can also Balance a file by starting at the very bottom, but this
  4849. may not work properly if the file contains any assembly–language
  4850. sections (see “The asm problem” at the end of this chapter).
  4851.  
  4852.  
  4853. §    Balancing a specific delimiter
  4854. Balance looks for a “hint” from you, as indicated by your insertion
  4855. point or selection, before going ahead. As mentioned above, you can
  4856. Balance one specific delimiter by selecting it just before the balance,
  4857. or by selecting an insertion point just to the left of it. If the
  4858. delimiter is not next to another delimiter, you can click on either
  4859. side of it. With comments and strings it is best to start the Balance
  4860. off with a “hint”, that is, select one end of the comment or string
  4861. or click next to one end, since if you start in the middle of a comment
  4862. or string the text will be checked as strictly as possible, without
  4863. allowance for it being within a comment or string.
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872. (Balance will take the selected ')' as a hint)
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883. §    Nested and bad comments
  4884. Balance will detect all nested comments, and any comment that has one
  4885. end missing. In the case of a comment with one end missing , you will
  4886. be shown a “good” end in the vicinity of the bad one, and you’ll have
  4887. to deduce on your own where the other end should be. Comment errors
  4888. can sometimes be subtle and difficult to see, such as a space between
  4889. the '*' and the '/'.
  4890.  
  4891.  
  4892.  
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906. You may find it worthwhile to Balance all your source files with
  4907. EnterAct’s balance command, since comment errors can sometimes slip
  4908. past THINK C’s compiler, resulting in some of your code being quietly
  4909. treated as though it was commented out. This can have unpleasant
  4910. consequences—if you’re not lucky, it can generate a wild pointer. Note
  4911. that any files in your EnterAct project are guaranteed to be free of
  4912. these comment errors after a successful Update Dictionary, since the
  4913. dictionary–builder checks comments thoroughly.
  4914.  
  4915. The one price to be paid for EnterAct’s improved comment checking is
  4916. that you should not use a comment start or end within a comment. Such
  4917. things as
  4918.     /*.../*...*/
  4919. and
  4920.     /*...*/...*/
  4921. will be treated as errors, both by the Balance command and by the
  4922. dictionary–builder. If you do need to use a comment start or end within
  4923. a comment, the general cure is to place some character between the star
  4924. and the slash. A space will do, or you could be pedantic and place each
  4925. character in separate single quotes, for example instead of /* use /
  4926. * or '/''*'.
  4927.  
  4928. Well, OK—some of you deliberately double up your comment starts to save
  4929. on typing. If you do this, select the Options command under the Edit
  4930. menu and uncheck the “Detect nested comment starts” check box. This
  4931. affects the dictionary builder also.
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953. §    Starting in the middle
  4954. If your selection doesn’t indicate a hint, Balance first looks
  4955. backwards in your file for a delimiter; when it finds one, it then
  4956. looks forwards for another delimiter, hoping to match them up. Of
  4957. course, if you supply an opening delimiter as a “hint”, or start from
  4958. the top of the file, Balance will proceed in the forward direction
  4959. immediately.
  4960.  
  4961. On rare occasions you may wish to balance the contents of a comment
  4962. or string as though it were code, and not just text. To do this, click
  4963. or select a range of characters within the comment or string, away from
  4964. either end. Balance will then check all delimiters as it works
  4965. outwards, until it encounters one end of the comment or string and
  4966. “realizes” that it has been fooled. 
  4967.  
  4968. By the way, EnterAct also accepts “C++” style comments, as in
  4969.     //comment beginning with two slashes, to end of line
  4970. but only to the extent of skipping over the contents when balancing.
  4971. If you start the Balance within this sort of comment it may just
  4972. beep at you. 
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005. §    The asm problem
  5006. If Balance runs into an “asm {...}” construction while looking
  5007. backwards through your code, it just plain won’t know that it’s inside
  5008. an asm. Any error you’re shown in this one circumstance is not to be
  5009. trusted, since it will almost certainly be due to a delimiter inside
  5010. an assembly–language comment (they start with a semicolon). 
  5011.  
  5012. When you balance a file from the top, all asm constructions will be
  5013. handled properly. The dictionary–builder, by the way, also handles
  5014. asm’s properly. Be warned that in other cases if you ask Balance to
  5015. run backwards through a block of assembly language it will hiccup if
  5016. it runs into a delimiter within an assembly–language comment. This is
  5017. a bug, but I haven’t found a cure that wouldn’t slow balancing down
  5018. to a crawl. 
  5019.  
  5020. Because of this problem it is best to always balance an entire file
  5021. by starting from the top rather than from the bottom, unless you’re
  5022. sure that the file contains no assembly language.
  5023.  
  5024. To Balance an assembly–language block, or a function containing
  5025. assembly language, select or click next to the opening curly brace '{'
  5026. at the top rather than the closing curly brace.
  5027.  
  5028. Otherwise, this will only be a problem if you’re balancing inside a
  5029. function that contains a block of assembly language. Then, you should
  5030. select opening delimiters rather than closing delimiters before
  5031. balancing. 
  5032.  
  5033.  
  5034. -    -    -    -    -    -    -    -    -    -    -    -
  5035. Search
  5036. -    -    -    -    -    -    -    -    -    -    -    -
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048. (both Find and Replace strings are limited to 255 characters)
  5049.  
  5050. §    Introduction
  5051. Single and multi–file searches in EnterAct are controlled by a modeless
  5052. Find dialog. The one important novelty is that you fine–tune your
  5053. multi–file selection by holding down the <Option> key and dragging over
  5054. the files in the project window (bullets • appear beside each file
  5055. included in the search). Your multi-file selection can also be used
  5056. to remove files from a project, or used by a hAWK program as a list
  5057. of files to take input from.
  5058.  
  5059. Replace, Replace and Find Again, and Replace All are all undoable.
  5060. The commands Find, Find Again, and Enter Selection all function when
  5061. the project window is in front, and the “find” commands also function
  5062. when the project window is just behind the Find dialog. Find commands
  5063. will search the currently active pane, useful if you are trying to spot
  5064. one file in a long list, or pick out files with similar names. Enter
  5065. Selection will enter the currently-selected file name in the Find
  5066. dialog.
  5067.  
  5068.  
  5069. §    Find is modeless
  5070. This requires a few minor adjustments in the way you search. 
  5071. There is no Cancel button in the Find dialog box—it has a Close box
  5072. instead. 
  5073.  
  5074. While the Find dialog is the front window, search commands that deal
  5075. with single files will apply to the window just beneath the Find
  5076. dialog. Replace All is excepted because it can cause multiple changes,
  5077. so to use this command you must have the text window in front.
  5078.  
  5079. Find and Find Again also function if the Find dialog is in front of the
  5080. project window, searching the current pane as though it were a text
  5081. list of file names (actually, that’s what it is…).
  5082.  
  5083. The “Find” button is the equivalent of the Find Again command. When
  5084. you click the Find button or select Find Again, the window just beneath
  5085. the Find dialog will be brought to the front, and the next instance
  5086. of your find string shown. The Find dialog will stay on–screen, moving
  5087. just behind the window being searched, so to find again you can if you
  5088. wish leave your mouse stationed over the Find button and double–click
  5089. (not a true double–click, the first click brings the Find dialog to
  5090. the front, and the second does the Find Again).
  5091.  
  5092. Buttons for multi–file searching are incorporated directly in the Find
  5093. dialog (more on this in “Multi-file searches” below). To modify your
  5094. multi–file search selection of files, hold down the <Option> key and
  5095. drag over the file names in the project window. You’ll see the
  5096. “eyeball” cursor while doing this.
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110.  
  5111.  
  5112.  
  5113.  
  5114. §    Find options
  5115. Select “Match Words” if  you don’t wish to match a longer string that
  5116. contains your find string in a form that makes a different word. For
  5117. example, the string “Open” will also match “Opening”, “Opened” etc
  5118. unless you select the “Match Words” option in the Find dialog.
  5119.  
  5120. A special case: if your string begins or ends with punctuation, such
  5121. as “->structMember” then leave “Match Words” unselected.
  5122.  
  5123. “Wrap Around” will continue your search from the beginning of your
  5124. document if the next Find runs off the bottom end of it. 
  5125.  
  5126. This also affects the Replace commands: to Replace All instances in
  5127. a file, it’s simplest to select an insertion point at the top of the
  5128. file beforehand; to Replace All instances below a certain point, click
  5129. just before the position where you want the replacing to start, and
  5130. leave “Wrap Around” deselected.
  5131.  
  5132. “Ignore Case” treats upper and lower–case letters as the same.
  5133.  
  5134. §    Batch Find options
  5135. If you click the "Batch" check box, your multi-file search will be
  5136. done all at once, and the results presented in a text window
  5137. (file name, line number, and the full line where found). To view
  5138. a particular found instance in the original file, click on the result
  5139. line and use "Go to...".
  5140.  
  5141. For Batch finds, if you select "List markers" then the line that lists
  5142. a particular location will include the containing function name.
  5143. Here's an example result (results appear in the stdout window):
  5144.  
  5145. Batch find results for: «nextName»
  5146. --------------------------------------------
  5147. «CEDAR_AutoLook.c»  3513 |ResolveOneLink| Boolean ResolveOneLink(StringPtr t1, short nextName, Handle *hTextP, long *primaryLinkP)
  5148. «CEDAR_AutoLook.c»  3524 |ResolveOneLink|         // Note nameLink0 is set only if nextName == 0.
  5149. «CEDAR_AutoLook.c»  3841 |GetSomeTypeNameForMember| /* typeLink1 is the index of a type name, nextName is sNameChain index
  5150. «CEDAR_AutoLook.c»  3843 |GetSomeTypeNameForMember| for nextName (and if nextName is 0 set nameLink0), return TRUE;
  5151.  
  5152. Once again, to jump to a particular instance, click on the line that
  5153. contains the file location and use "Go to...".
  5154.  
  5155. Please see "§    Skip '-' : excluding files from a search" below if you wish
  5156. to skip certain files easily while searching or carrying out some
  5157. other multi-file operation.
  5158.  
  5159. §    Dual Batch Find
  5160. Translated into English, the dialog that appears when you click the
  5161. Dual Batch Find button in the Find dialog lets you do "Find two
  5162. strings wihin a certain number of lines or characters of each
  5163. other". This is a multi-file operation, that is it looks in files
  5164. that you've bulleted for multi-file searches, and it's a Batch
  5165. operation in that it presents its result in the stdout window.
  5166.  
  5167. To find the two strings on the same line, enter a zero for the
  5168. number of lines. Zero characters means the two strings must
  5169. be found right together with no characters in between.
  5170.  
  5171. Dual Batch Find is a sort of mini-grep for dummies (like me).
  5172. hAWK can perform full grep searches if you need the extra power
  5173. (but in practice I've found that setting up grep searches is too
  5174. error-prone for casual use).
  5175.  
  5176. §    <Tab> and <Return>
  5177. A plain <Tab> will jump your cursor from one edit field to the other,
  5178. and a plain <Return> is the equivalent of the “Find” button. To enter
  5179. a <Tab> or <Return> in either the find or the replace text, hold down
  5180. the <Command> key while typing the character.
  5181.  
  5182.  
  5183. §    Find again
  5184. This menu command is the equivalent of the “Find” button in the Find
  5185. dialog, and finds the next instance of your find string in accordance
  5186. with your Find options (see above). Find Again searches the front
  5187. window, or, if the Find dialog is in front, the window just behind the
  5188. Find dialog.
  5189.  
  5190. Find Again also works with the project window, allowing you to search
  5191. for part of a file name in a long list of files. It searches the active
  5192. pane only (the one with filled-in scroll bars).
  5193.  
  5194.  
  5195. §    Enter selection
  5196. Enter Selection will replace your current find string with whatever
  5197. text you have selected. It works with any text window including lookup
  5198. windows, and also the project window (in case you wish to search for
  5199. a file name). If your Find dialog is on–screen, you will see the new
  5200. find string in the dialog.
  5201.  
  5202.  
  5203. §    Recent finds are remembered
  5204. Your most–recent find strings will be stored in the popup “Find:” menu
  5205. at top–left of the Find dialog. Selecting an item from the popup will
  5206. copy it to your find string box.
  5207.  
  5208. Two minor limitations apply: find strings containing <Return>s or more
  5209. than 48 characters will not be remembered by the popup menu.
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.  
  5223.  
  5224.  
  5225.  
  5226.  
  5227.  
  5228.  
  5229.  
  5230.  
  5231.  
  5232.  
  5233.  
  5234. §    Replace
  5235. Replace can be thought of as a Paste for short strings (up to 255
  5236. characters). The replacement text is taken from the replace string in
  5237. the Find dialog. No checking is done to see if the selection that will
  5238. be replaced corresponds to your find string, so the replacement string
  5239. can in effect be used as a second (small) clipboard. To set up a choice
  5240. between two “Paste” alternatives, enter one selection into the
  5241. replacement string in the Find dialog, and then Copy the other
  5242. selection. Then Paste or Replace in your document as appropriate.
  5243.  
  5244. If the Find dialog is in front, Replace will affect the window just
  5245. behind the Find dialog.
  5246.  
  5247. Replace is undoable provided the window in which the Replace was done
  5248. is in front, and provided you don’t perform some other undoable action
  5249. before undoing.
  5250.  
  5251.  
  5252. §    Replace and Find Again
  5253. This command is the exact equivalent of Replace followed by Find Again,
  5254. and is undoable.
  5255.  
  5256.  
  5257. §    Replace All
  5258. Unlike other search commands, Replace All cannot be called when the
  5259. Find dialog is in front—you must specifically bring frontmost the
  5260. window in which you wish to use Replace All. This small awkwardness
  5261. is an attempt to remind you that Replace All is the one editing command
  5262. that can make a real mess of your document. However, it is undoable—as
  5263. with other undoable operations, you need only have the correct window
  5264. in front before undoing.
  5265.  
  5266. If you have selected the “Wrap Around” option in the Find dialog,
  5267. Replace All will indeed replace all instances of the find string with
  5268. the replace string throughout your document. If “Wrap Around” is not
  5269. checked, replacement will be done only below your current position in
  5270. the text. To prevent a single instance of the find pattern from being
  5271. replaced, select at least the first character of the instance in your
  5272. document just before Replace All (selecting all of it will do).
  5273.  
  5274.  
  5275. §    Multi–file searches
  5276. Any file in your project can be added to a list of files to be
  5277. searched. Files that are included in a multi–file search will have a
  5278. bullet • just to the left of the name in the project window.
  5279.  
  5280. “Coarse” setup of the multi–file search is done with the small buttons
  5281. in the lower–right of the Find dialog. These allow you to select all
  5282. files of a particular type—.c, ".h", <.h>, or plain text. The “None”
  5283. button will clear the multi–file search selection, and the “All” button
  5284. will add all of your project text files to the list. A counter in the
  5285. Find dialog shows how many files will be searched.
  5286.  
  5287. To “fine–tune” your list of files to be searched, hold down the
  5288. <Option> key and click on or drag over the files in the project window.
  5289. The cursor will change to an eye, and bullets beside the file names
  5290. will appear or disappear as you drag up and down over the files. There
  5291. is an illustration of this near the beginning of this chapter.
  5292.  
  5293. Once your files are selected (and you’ve entered what you want found
  5294. in the find string in the Find dialog) select Find In Next File or
  5295. click the equivalent button in the Find dialog. As the search
  5296. progresses, you will see the bullets beside file names in the project
  5297. window disappear as each file is searched. The counter in the Find
  5298. dialog will also count down the number of files remaining. If an open
  5299. file is searched by Find In Next File, it will be searched from the
  5300. beginning of the file. When an instance is found, Find Again will
  5301. locate other instances in the same file. To continue the multi–file
  5302. search with the next  file, select Find In Next File again.When all
  5303. files have been searched, you’ll hear a beep, the counter in the Find
  5304. dialog will read zero, and all bullets will be gone from the project
  5305. window.
  5306. Even if you don’t find anything, it puts on a nice show.
  5307.  
  5308. A <Command><period> will interrupt a multi–file search, and also clear
  5309. the list of files to be searched.
  5310.  
  5311. To generate a list of all instances of your search string, click
  5312. the "Batch" check box before doing your Find In Next File. Results
  5313. of the search will be shown to you in the "$tempStdOut" window
  5314. in the format «file name» line-number line-where-found, and
  5315. to view a particular instance in its original context click on the
  5316. line and use "Go to...".
  5317.  
  5318. By the way, your list of bulleted files in the project window can also
  5319. be used to remove those files from your project (see “Remove •'d Files”
  5320. in the “Projects” chapter), and used by a hAWK program as a list of
  5321. input files (see Appendix 2, and the hAWK User’s Manual on disk 2).
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337. §    Skip '-' : excluding files from a search
  5338. In the Find dialog, the "Skip '-'" checkbox lets you exclude project files
  5339. that are marked with a dash '-' when carrying out a multi-file operation
  5340. such as searching. These dashes are primarily used to exclude files
  5341. from a dictionary build, and are placed by holding down the <Command>
  5342. key and clicking on the file's name in the project window. But you
  5343. may also wish to skip over these files when multi-file searching: if
  5344. so, you should turn this checkbox on in the Find dialog before
  5345. carrying out the search. Note if the "Skip '-'" option is on, then files
  5346. with a '-' beside them will not be passed to hAWK in your multi-file
  5347. selection, and they will not be removed from your project when
  5348. you pick "Remove •'d Files", whether or not they have bullets beside
  5349. them. Neither will they be selected or deselected for searching if
  5350. you click on the "All" or "None" buttons in the Find dialog.
  5351.  
  5352. If you have the "Skip '-'" checkbox turned on, then when you fine-tune
  5353. your multi-file selection by <Option>clicking in the project window
  5354. you will not be able to place bullets beside files that have a dash '-'
  5355. beside them. But note that "Skip '-'" takes precedence, so if you
  5356. put bullets beside files that have dashes and then turn on "Skip '-'",
  5357. those dashed files will not be included in multi-file operations.
  5358. At any time, the "Files to search:" number in the Find dialog
  5359. accurately shows the total number of files that will be searched,
  5360. so if "Skip '-'" is on then dashed files will not be included in the total.
  5361.  
  5362. To run a multi-file operation (such as the hAWK program
  5363. "$EchoFullPathNames", or a Batch Find) on just files that
  5364. are not marked with a '-':
  5365. • select "Skip '-'"
  5366. • mark the files with bullets (eg by clicking the All ".c" button
  5367. or by holding down the <Option> key and clicking on project file
  5368. names)
  5369. • run the multi-file operation.
  5370.  
  5371. To run a multi-file operation on all excluded files, ie those
  5372. that are marked with a '-':
  5373. • deselect "Skip '-'"
  5374. • click the "All" button in the Find dialog
  5375. • select "Skip '-'"
  5376. • click the "None" button in the Find dialog
  5377. (this will leave bullets beside files marked with a '-')
  5378. • deselect "Skip '-'" again so the bulleted files won't be ignored
  5379. • run the multi-file operation.
  5380.  
  5381. §    THINK Find commands
  5382. Located under the Search menu near the bottom, three commands allow
  5383. you to make use of the THINK Project Manager's "Find" results from
  5384. within EnterAct. To use these commands, you must use THINK C 6 or
  5385. later, and set up EnterAct as the Project Manager's editor as described
  5386. in Appendix 4 here.
  5387.  
  5388. After completing a "batch" find in THINK C, you can use the THINK
  5389. Find Again and THINK Find Previous commands to step through the
  5390. results. These two commands work only with the results of a
  5391. batch find.
  5392.  
  5393. To start or continue a multi-file search using the THINK Project
  5394. Manager's multi-file search rather than EnterAct's, use the
  5395. THINK Find In Next File commands after setting up the (non-batch)
  5396. search in the THINK Project Manager. Note this means you can perform
  5397. and even alternate between two separate multi-file searches, THINK's
  5398. and EnterAct's.
  5399.  
  5400. Find in THINK Reference does the same thing as the command of the
  5401. same name in the THINK Project Manager's editor: it passes your
  5402. currently-selected text over to THINK Reference, where you'll be
  5403. shown any entry it has on the name in question. Note this works only
  5404. with THINK Reference version 2 or later.
  5405.  
  5406. To use EnterAct's "Find in THINK Reference" command under any
  5407. circumstances, create a folder named "Tools" or "(Tools)" next
  5408. to EnterAct and drop an alias of Think Reference in it.
  5409.  
  5410. Find in Toolbox Assistant is much the same, just drop an
  5411. alias of QuickView in your Tools folder.
  5412.  
  5413. -    -    -    -    -    -    -    -    -    -    -    -
  5414. “Go” commands
  5415. -    -    -    -    -    -    -    -    -    -    -    -
  5416. Of the four “Go” commands under the Search menu, the most important
  5417. is the “Go to” command. This command allows you to jump to any marked
  5418. position in any project file, and since the marker position is
  5419. maintained as you edit, so is your ability to jump to it. The standard
  5420. suite of “go” capabilities is also available.
  5421.  
  5422.  
  5423. §    Go to Top/Bottom
  5424. The Go to Top and Go to Bottom menu commands do the same thing as
  5425. <Option><up arrow> and <Option><down arrow>, namely take you to the
  5426. top or bottom of your text window. They also function in the project
  5427. window.
  5428.  
  5429.  
  5430. §    Go to
  5431. The Go to command allows you to jump to a fixed position or a marker,
  5432. based on the text you have selected in your front window. The position
  5433. or marker can be in any project file.
  5434.  
  5435. For example, you can jump to a specific marker in a specific project
  5436. file with Go to. And there is an easy way to generate the file name
  5437. and marker name text (pick the marker from its popup marker menu while
  5438. holding down the <Shift> key), as explained in “Going to markers” a
  5439. couple of pages ahead. A typical link of this form in your code might
  5440. look like
  5441.     /* See «MyProject Log» «Conversation with J.B. re New Features» */
  5442. where the project file is “MyProject Log” and the marker name is inside
  5443. the second set of Euorpean quotes «». You could jump to the marker in
  5444. your “MyProject Log” file by clicking anywhere on the line mentioning
  5445. the file and marker and then selecting Go to. Selecting the
  5446. entire file name and marker name including the surrounding «» quotes
  5447. would also work. Since markers are maintained by most editors
  5448. (EnterAct, THINK C, and MPW for example), links of this form will also
  5449. be maintained as long as the marker exists and the file is in your
  5450. current project.
  5451.  
  5452. (If both file name and marker name are in «» quotes, then both file
  5453. and marker name can be highly abbreviated, eg
  5454.     /* See «Log»«J.B. News» */
  5455. —as with regular lookup, your spelling just needs to be
  5456. “distinctively close”, in terms of runs of matching characters
  5457. when comparing against file and marker names in your project.
  5458.  
  5459. Go to also works with file names or marker names alone, or with line
  5460. and character positions in a file, or with file name followed by line
  5461. and character position. And it also accepts full path names.
  5462.  
  5463. The following terms are used below to help summarize selection
  5464. possibilities:
  5465. file_name:         the name of a project file, optionally enclosed in
  5466.     European-style quotes, ie «». Your selection will be extended to
  5467.     include any trailing file extension (such as “.c” or “.NOTES”),
  5468.     provided your basic selection is not by itself the name of a project
  5469.     file. This could also be a full path name.
  5470. marker_name:     the name of a marker in a project file, optionally
  5471.     enclosed in European style quotes «». Note the name of the marker
  5472.     should be specified, not the text (if any) that is selected when you
  5473.     jump to the mark.
  5474. text_position:     line number, optionally followed by character position
  5475.     on the line, for example 123 6 to specify the 123rd line in a file,
  5476.     just before the 6th character. The first line in a file is line 1, and
  5477.     the insertion point before the first character on a line is character
  5478.     position 1.
  5479. other_text:     by itself, text that is none of the above; following a
  5480.     file_name, text that is not a marker_name or text_position.
  5481. insertion_point: an empty selection.
  5482.  
  5483. Go to acts on selections in the following ways:
  5484. file_name     :                open the project file, or just bring it to the front if
  5485.                                 open
  5486. marker_name :            equivalent to selecting the marker from the window’s
  5487.                                 marker menu
  5488. text_position :            go to the position specified
  5489. file_name marker_name :     open the project file or bring it to front, and
  5490.                                 go to the marker specified
  5491. file_name text_position :     open the project file or bring it to front,
  5492.                                 and go to the position specified
  5493. file_name other_text :        open the project file or bring it to front, then
  5494.                                 use “Find” on the other_text in an attempt to locate it
  5495. other_text :                display a dialog in which to enter a line number to jump
  5496.                                 to.
  5497. insertion_point :        if the text of the link is quoted, ie file_name or
  5498.                                 marker_name if present are within «» quotes, then
  5499.                                 clicking anywhere on the line is sufficient to select
  5500.                                 the link for goto purposes. Otherwise, you will be
  5501.                                 shown the line number dialog, as with “other_text”
  5502. Note if both file name and marker name are in «» quotes you can use
  5503. extremely abbreviated versions of the names: the file name just has
  5504. to be "distinctively close" to the name of a project file, likewise
  5505. the marker name to a marker in that file.
  5506.  
  5507. Selections intended for the Go to command are called Go to selections
  5508. or “Go to” links in this manual. Here are some examples:
  5509.  
  5510.  
  5511. (a file_name link: note selecting the “.h” is optional)
  5512.  
  5513.  
  5514. (file_name in quotes followed by line number and character position
  5515. on line—for Go to, any insertion point on the line will do)
  5516.  
  5517.  
  5518.  
  5519. (instead of an insertion point, you can select all of the file_name
  5520. text_position)
  5521.  
  5522.  
  5523.  
  5524. (unquoted version of the same)
  5525.  
  5526.  
  5527.  
  5528. (file_name marker_name: with both in quotes, your selection can be
  5529. an insertion point anywhere on the line, here between the file and
  5530. marker names)
  5531.  
  5532.  
  5533.  
  5534.  
  5535. (without quotes, you must select the entire file_name marker_name)
  5536.  
  5537.  
  5538.  
  5539.  
  5540. (a marker-name link in the document “Proj Interface.DSGN”? Probably.
  5541. But it could also be a file name, or a marker in some other document.
  5542. The context of your current project and front window will determine
  5543. what  «Modifier keys»  is, and where you go to. Note for Go to
  5544. purposes, you could also just click in the line rather than selecting.
  5545.  
  5546. The one important restriction on Go to is that if you specify a file
  5547. name, the file you are going to must be in your currently open project.
  5548. If it isn’t, you can add it with the Add Files command.
  5549.  
  5550. To resolve ambiguity, file names take precedence over marker names.
  5551. And if you should have a marker name that looks like a text position,
  5552. enclosing it in quotes«» will force treatment as a marker name.
  5553.  
  5554. The file name can be the name of a PICT file, by the way, allowing you
  5555. to use single pictures as popup illustrations. And Go to works with
  5556. file names selected in the project window, performing the same as if
  5557. you double-clicked on the file name to open the file.
  5558.  
  5559. Spaces or tabs before, between, or after the components of a Go to
  5560. selection will be ignored. Hence the enclosing «» quotes are required
  5561. if a file name or marker  name begins or ends with “white space”.
  5562. Otherwise they’re optional, but quotes do help Go to selections to
  5563. stand out quietly from the surrounding text. And if both file name and
  5564. marker names are quoted, clicking anywhere on the line is
  5565. equivalent to selecting both parts for Go to purposes, a handy
  5566. shortcut. Quotes are included when you copy a marker name (and file
  5567. name) from a marker menu, as explained in “Going to markers” on the
  5568. next page.
  5569.  
  5570. If you have included a file name in your Go to selection but are
  5571. immediately shown the line number dialog instead of the desired file,
  5572. this means you haven’t yet added the file to your project. If you see
  5573. a message that the file couldn’t be found, this means the file has been
  5574. moved, renamed, or deleted since you added it to your project, and the
  5575. solution is to delete the file from your project and re-add it. If a
  5576. line that you go to seems to be the wrong line, this normally just
  5577. means that the file has been edited (lines added or deleted) since the
  5578. line number was specified. And if going to a marker doesn’t work, this
  5579. usually means that the marker has been deleted from the file (note that
  5580. if you delete the actual text marked then you lose the marker, even
  5581. if you immediately undo the delete).
  5582.  
  5583. File-name line-number links are of limited use, since the line numbers
  5584. can quickly become obsolete. Links of this form are however generated
  5585. by EnterAct and by hAWK programs when displaying lists of positions
  5586. (see the next section). File-name marker-name links are better for your
  5587. own use since their locations are maintained for you, and you’ll find
  5588. in the “Going to markers” section below an easy way to generate the
  5589. necessary text for them. And any existing mention of a file name or
  5590. marker name in any of your project documents is now a “Go to” link,
  5591. as you no doubt gathered -- just add the corresponding document to
  5592. your project.
  5593.  
  5594. §    Going to included files
  5595. To jump to the top of an included file such as
  5596. #include "thisheader.h"
  5597. click on the line and select "Go to...".
  5598.  
  5599. Note if you have more than one header file with the same name
  5600. in your project you might not get the right one.
  5601.  
  5602. §    Going to text positions
  5603. Text positions compatible with the Go to command are displayed by the
  5604. Show Activities command, for example:
  5605.     ¶60
  5606.     Sat Jan 16, 1993 10:51:48 pm PASTE «hAWK_FilesandClip.c» 390 4
  5607.     =>inserted 50 characters:
  5608.     «if (!dirs && !(fpb->ioFlAttrib & 16)) /* a file */»
  5609.     ¬
  5610. To see the place where this paste took place, you would select
  5611. “«hAWK_FilesandClip.c» 390 4”, or just click in the line
  5612. somewhere, and then Go to. For details, please see the “Show
  5613. Activities” chapter. For now, note that the Show Activities
  5614. command can update the text positions (and even file names) for
  5615. you, to keep them as current as theoretically possible, which is to
  5616. say almost always useful.
  5617.  
  5618. Many hAWK programs generate file-name line-number text that is
  5619. compatible with the Go to command. For example, $CompareFiles shows
  5620. document differences in this form, and $XRef generates file name and
  5621. line number listings for C terms in your source code. Several of
  5622. the Index commands under the EnterAct menu also generate line
  5623. numbers.
  5624.  
  5625. Text positions can be used to link documents together, but you’ll
  5626. usually find it better to use marker names instead (see just below).
  5627. The reason is that marker positions are maintained as you edit files,
  5628. whereas line numbers can go out of date quickly.
  5629.  
  5630.  
  5631. §    Going to markers
  5632. The ability to “go to” any marker in any project file means you can
  5633. use a file name followed by a marker name as a true “hyperlink”,
  5634. especially useful for placing references to supporting documentation
  5635. in your source files or other documents.
  5636.  
  5637. To generate the necessary text for establishing a file-name marker-name
  5638. link:
  5639.     •    open the file that contains the marker
  5640.     •    hold down the <Shift> and <Option> keys, and click-and-drag in the
  5641.         window’s title bar to access the popup marker menu; select the marker
  5642.         you want
  5643.     •    the link, in the form «file name» «marker name» , is now on the
  5644.         clipboard, ready for pasting.
  5645.     •    (note <Shift> <Command> will also work when picking from a marker
  5646.         menu)
  5647. EnterAct places «» quotes around both the file name and the marker name.
  5648.  
  5649. To generate file-name marker-name link text for all markers in one or
  5650. more files, use the "Index Marker Names" command under the EnterAct
  5651. menu, as described in the "'Index' commands" chapter.
  5652.  
  5653. With quotes around both the file name and marker name, you can “select”
  5654. a file-name marker-name for Go to purposes by clicking anywhere on
  5655. the line if it's the only link on the file, or between the two quoted
  5656. bits of text otherwise. Your selection will be expanded to include the
  5657. quoted file name and marker names when you pick Go to. And with
  5658. both file and marker name in «» quotes you can use highly abbreviated,
  5659. even slightly incorrect versions of the names, provided those names
  5660. are distinctively close to the names of a file in your project and a
  5661. marker in that file (in terms of case-sensitive runs of matching
  5662. characters).
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.  
  5690.  
  5691. To go to the position referenced by a file-name marker-name link,
  5692. click on the line containing the link text,
  5693. and then issue a Go to (see next illustration).
  5694.  
  5695. On the chance that too many new things at once have pushed some old
  5696. things out the bottom of your memory stack, a reminder that to jump
  5697. to the definition of a term that’s in your current project dictionary
  5698. just <Option> double-click on it. File-name marker-name links are
  5699. mainly for jumping to places in your (unparseable) supporting
  5700. documentation.
  5701.  
  5702. Tip: if you want to be able to jump to an illustration in a text file,
  5703. mark its location and then copy the marker name for pasting elsewhere.
  5704.  
  5705.  
  5706. §    Go Back
  5707. This command takes you back to your last signficantly different
  5708. position in a text file. Usually the two positions will be in the same
  5709. file, and a typical use is to “toggle” back and forth within a function
  5710. between the spot where you’re creating code and the top of the function
  5711. where the locals and parameters are declared.
  5712.  
  5713. Whenever you move your insertion point or make a new selection, you
  5714. define a “significantly different” position to go back to if you: bring
  5715. a different text window to the front, or; click more than 3/4 of a
  5716. window away from your previous position. You can alter your current
  5717. position without spoiling the memory of your previous position by
  5718. inching along—click half a window away, scroll, click half a window
  5719. away, scroll….
  5720.  
  5721. You can also toggle between two positions in a file with markers, or
  5722. “go to” links, or by pressing <Enter> to switch between the top and
  5723. bottom ends of a large selection.
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.  
  5749.  
  5750.  
  5751.  
  5752.  
  5753.  
  5754.  
  5755.  
  5756.  
  5757.  
  5758.  
  5759.  
  5760.  
  5761.  
  5762.  
  5763.  
  5764.  
  5765.  
  5766.  
  5767.  
  5768.  
  5769. (Note the link text
  5770.     «hAWK User's Manual» «F        Running hAWK programs»
  5771. could have been abbreviated as say
  5772.     «hAWK Man»«running»
  5773. —when both file and marker name are in «» quotes, the file
  5774. and marker names just have to be reasonably close to the
  5775. actual names.)
  5776.  
  5777. -    -    -    -    -    -    -    -    -    -    -    - - -
  5778. Markers and the Locations menu
  5779. -    -    -    -    -    -    -    -    -    -    -    - - -
  5780. §    Introduction
  5781. A “marker” is a marked location in your text consisting of a start
  5782. point, an end point, and a name to be associated with the marked
  5783. position. Typically, you’ll place markers in your C source files
  5784. all at once with the Automark command, and you’ll place markers in
  5785. supporting documents one-at-a-time with the Mark command. Marks can
  5786. be placed in header files with Automark, but you may prefer to use
  5787. Mark. To bring up a popup menu of a window’s markers, hold down the
  5788. <Option> or <Command> key and click in the window’s title bar.
  5789.  
  5790. EnterAct's default behavior is to automatically generate markers
  5791. for all functions in source files and all struct/class definitions
  5792. in header files as you open or save the files, and to not save those
  5793. markers with the document. If you manually insert markers in a
  5794. document that goes in your project's rightmost (documentation)
  5795. pane, these markers will be saved with your document when you
  5796. save the file (this manual is an example). You can force EnterAct
  5797. to save source and header file markers with your files by
  5798. enabling the the “Save source/headers marks” option, but the
  5799. only use for this at present is to allow the “Index Marker Names…”
  5800. command to index marks in your source files.
  5801.  
  5802. At present EnterAct does not support #pragmas for inserting
  5803. special markers in source files.
  5804.  
  5805. Markers do stay attached to the proper position as you edit the file
  5806. around them, but any editing that’s done inside the marked range will
  5807. correspondingly expand or shrink the range associated with the marker.
  5808. If you remove all of the text that is within the marked range, you will
  5809. also remove the marker, and this is not undoable. Markers do not
  5810. survive cutting or pasting—they stay attached to the text only as long
  5811. as the text remains in the document. 
  5812.  
  5813. The Automark command is mainly useful to mark all of the function
  5814. definitions in a source file, though it has other options, and can be
  5815. used to mark a variety of C constructs, with the option of marking just
  5816. the first in a group.
  5817.  
  5818. Marker names can be used as links within or between files, in
  5819. conjunction with the Go to command. Called “Go to” links, these take
  5820. the form
  5821.     «file name» «marker name»
  5822. where the enclosing «» quotes are usually optional. Where a link is
  5823. present in your text, you can go to it by selecting the file name and
  5824. marker name (including «» quotes if present), or by clicking anywhere
  5825. on the line, and issuing the Go to command. For an easy way to
  5826. generate the text for these links, see “Copying marker names” below.
  5827. You’ll find details on using “Go to” links in the “‘Go’ commands”
  5828. chapter.
  5829.  
  5830. Please note your markers will be maintained properly only by editors
  5831. that implement MPW–compatible marks. However, if you use Automark to
  5832. set all of your marks in a source file, then re–marking such a file
  5833. after editing it with such an editor will be relatively painless—just
  5834. use Automark again with your preferred options checked, and check
  5835. “Clear all present markers first”. Normally, however, you won't
  5836. have to re-mark a source file yourself; Enteract's default behaviour
  5837. is to re-mark source files for you automatically if they have been
  5838. changed by another editor (this is an option in the "Options..." dialog).
  5839.  
  5840.  
  5841. §    Mark
  5842. To place a single marker, select either an insertion point or the range
  5843. of text that you want remembered, and then select the Mark command.
  5844. You will be asked to supply or modify a name for the marker: click Add,
  5845. and then forever after you will be able to jump to that marker whenever
  5846. you want (marks are saved to disk and properly maintained).
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857. §    Marker menus
  5858. Every document containing marks has a popup marker menu associated with
  5859. its window. To jump to a marker, hold down either the <Option> or
  5860. <Command> key or both and click-and-hold in the title bar of your
  5861. window. You’ll see a popup menu listing all of the markers attached
  5862. to your file. Pick one, and you go there. The markers are in
  5863. alphabetical order.
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.  
  5885.  
  5886.  
  5887.  
  5888.  
  5889.  
  5890.  
  5891.  
  5892. If the name of a marker is present in your text, you can also go to
  5893. it by selecting the name and using the Go to command, as explained in
  5894. the “‘Go’ commands” chapter.
  5895.  
  5896.  
  5897.  
  5898. §    Unmark
  5899. To remove one or more markers, select Unmark. You will be presented
  5900. with a list of markers to select for deletion. This list follows the
  5901. standard Macintosh rules for list selection: click with no keys held
  5902. down to select a single marker (this deselects any other selected
  5903. markers); click with the <Shift> key down to select a contiguous range
  5904. of markers while dragging the mouse; and click with the <Command> key
  5905. held down to select a marker that is away from other selected markers
  5906. (the markers in between are left unselected). 
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922. To quickly remove all markers from a document, use the Automark command
  5923. with only the “Clear all present markers first” option checked.
  5924.  
  5925.  
  5926. §    Automark
  5927. (Note: The "AutoMark source..." check box in the Options dialog
  5928. will create marks for all functions in a source file when you open it,
  5929. if the file has in the meantime been changed by some other editor.
  5930. This is handy if you're using EnterAct in conjunction with some other
  5931. editor that doesn't support markers, such as CodeWarrior. This option
  5932. is fast enough on most machines that you can just leave it checked
  5933. and not worry about it.)
  5934.  
  5935. This command works with any first-draft or compilable C file, whether
  5936. or not it has been added to your project. You’ll find its main use is
  5937. to mark all of the function definitions in a source file, after
  5938. deleting any existing markers, and this is the default action.
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.  
  5948.  
  5949.  
  5950.  
  5951.  
  5952.  
  5953.  
  5954. If you wish to keep special markers that you have manually added, leave
  5955. “Clear all present markers first” without a check mark. When a
  5956. duplicate name or position is found while adding markers, the new entry
  5957. will replace the old one.
  5958.  
  5959. The “first of group only” checks have slightly different
  5960. interpretations: for #defines, it means mark only the first of a group
  5961. of consecutive #defines; for enum constants, it means mark only the
  5962. first within an enum {} statement; and for variables it means mark the
  5963. first of a group of consecutive variables, whether they occur in the
  5964. same statement or in separate statements. If you leave some types
  5965. unselected then EnterAct’s automarker won’t count them as separating,
  5966. say, two groups of variables or #define’s.
  5967.  
  5968. To keep things sane, there is a limit of 499 marks to a file. This is
  5969. a 9 foot popup menu, a bit tedious to scroll through even with a 68070.
  5970. Marker names are limited to 63 characters, but the range of text you
  5971. mark with the name can be as long as you want.
  5972.  
  5973. The Automark command can be used to remove all marks from any file
  5974. (source or not), by checking just the “Clear all present markers first”
  5975. option.
  5976.  
  5977.  
  5978.  
  5979. §    Copying marker names
  5980. To put text of the form «file name» «marker name» on the clipboard for
  5981. a particular marker, hold down the<Shift> key and either the <Option>
  5982. of <Command> key while clicking in the title bar of the marker’s window
  5983. to access the marker popup menu; selecting the marker from the popup
  5984. will put the text on your clipboard. This is the same as going to the
  5985. mark by selecting it from the popup marker menu, except that in
  5986. addition you hold down the <Shift> key.
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.  
  6015.  
  6016. Text of the form «file name» «marker name»  can be used with the Go
  6017. to command to jump to any marker in any project file, and variations
  6018. on this theme are available as detailed in the “‘Go’ commands” chapter.
  6019.  
  6020. §    The Locations menu
  6021. This menu allows you to mark and jump to up to 10 different locations.
  6022. You can mark positions in any text file, and they stay recorded in the
  6023. Locations menu until you delete them, independent of whatever project
  6024. you might have open. This is a generalization of the "Go Back" command,
  6025. allowing you to go back to any specific location.
  6026.  
  6027. If you edit files with some other editor, your remembered locations
  6028. may be thrown off, in which case you could delete and re-add them.
  6029. (Function and struct markers that are created automatically by
  6030. EnterAct are not thrown off if you edit files with some other editor.)
  6031.  
  6032. To add a position to the Locations menu:
  6033. • select the position you want, and optionally some text there
  6034. • pick Add Current Location from the Locations menu
  6035. • a dialog will appear which allows you to set the position's
  6036. name as it will appear under the Locations menu: if you selected
  6037. some text at the position to be marked, that text will appear in
  6038. the dialog. You can edit the name, put in an arbitrary name, or
  6039. have no name at all--in this case, EnterAct will concoct a name
  6040. for you, made up of the file name, line position, any enclosing
  6041. function name and maybe other stuff.
  6042.  
  6043. To jump to a position you've added to the Locations menu:
  6044. • pick it from the Locations menu.
  6045.  
  6046. To delete a position from the Locations menu:
  6047. • go to the position (pick it from the Locations menu for example)
  6048. • select Delete Current Location from the Locations menu
  6049. • if the location can't be found, you will be asked if you want to
  6050. delete the location from the menu.
  6051.  
  6052. When you hit the limit of 10 marked locations, you won't be able
  6053. to add any more until you delete one of the remembered locations.
  6054.  
  6055.  
  6056. -    -    -    -    -    -    -    -    -    -    -    -
  6057. Options, under the Edit menu
  6058. -    -    -    -    -    -    -    -    -    -    -    -
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.  
  6079.  
  6080.  
  6081. §    Introduction
  6082. You can change any of the options at any time. Defaults for the options
  6083. are shown in the figure above, and have been selected to give best
  6084. performance under average conditions. Options are saved with EnterAct
  6085. itself rather than a project. Some of them you’ll set once and forget,
  6086. but the number of lookup windows and the number of entries per lookup
  6087. determine how cluttered your screen can get, and how many alternate
  6088. entries a lookup window will hold, so you’ll vary these two numbers
  6089. to suit particular circumstances.
  6090.  
  6091. For a discussion of “Safe switching under MultiFinder” see the next
  6092. chapter, “Switching to other applications”.
  6093.  
  6094. For a discussion of “Save activities to disk” see “Show Activities”
  6095. near the end, in the section “Turning activity recording on and off”.
  6096.  
  6097.  
  6098. §    Number of lookup windows
  6099. This box allows you to set the maximum number of lookup windows that
  6100. can appear on–screen at one time. For complicated situations you may
  6101. want more than 4, whereas on a small screen you may prefer fewer than
  6102. 4 to avoid clutter.
  6103.  
  6104.  
  6105. §    Number of entries per lookup window
  6106. The number in this box determines how may dictionary entries will be
  6107. retrieved in a lookup window, if your spelling does not match any term
  6108. in the dictionary exactly. If your spelling does match a term exactly,
  6109. all exact matches will be retrieved, up to a maximum of 60. You may
  6110. wish to temporarily increase the number in this box if your
  6111. recollection of the spelling of a term is shaky. On a regular basis,
  6112. you may prefer 3 or 5 entries rather than 4—a bit of experience will
  6113. tell.
  6114.  
  6115.  
  6116. §    Remembering window locations
  6117. By default, EnterAct will remember the window locations of all your
  6118. documents (saved in a small resource with the document). Also, you will
  6119. not be asked if you want to save changes to a document when you close
  6120. it if the only change is a change in window location (the “don’t
  6121. pester” option). You can take advantage of the remembered window
  6122. locations to work with groups of documents; arrange each group nicely
  6123. on the screen, and then if you later reopen the documents in that group
  6124. they will be arranged on–screen where you left them.
  6125.  
  6126.  
  6127. §    Long or short windows
  6128. If there is no remembered location for a document, or if you have
  6129. switched off the “Save document window locations” option, then a
  6130. newly–opened window will come up near the top of your screen, with a
  6131. relatively short or long length according to what you select in the
  6132. option “Windows open short/long by default”. You may not notice much
  6133. of a distinction if you have a small screen. This short/long option
  6134. always governs the appearance of new text windows, and of text files
  6135. created by other applications that have never been saved while using
  6136. EnterAct.
  6137.  
  6138.  
  6139. §    Reformat Selection options
  6140. Reformat Selection will rebreak the lines in a selection of text to
  6141. improve the appearance of the right margin. Aside from selecting a
  6142. “ragged right” or “full justification” look, you can also set the
  6143. maximum number of characters per line in the “Reformat line width” box.
  6144. The default of 74 gives a reasonable and printable line in Monaco 9.
  6145.  
  6146.  
  6147. §    Detect nested comment starts
  6148. This option is on by default, meaning that EnterAct will accurately
  6149. trap any single failure to properly start or end a comment, both while
  6150. building your dictionary and while balancing. If you are in the habit
  6151. of doubling up on comment starts, as in
  6152.     /*#define Flag37 /* if defined, use SlowDraw */
  6153. and if you are not willing to mend your ways, uncheck this option:
  6154. comment starts within a comment will then be ignored for dictionary
  6155. and balance purposes. Just make sure you type carefully!
  6156.  
  6157. §    Ignore 'ckid's
  6158. A 'ckid' is a resource that SourceServer uses to keep track of
  6159. whether a file is modifiable or read-only, and also if the file's
  6160. status has been changed from read-only to modifiable by an
  6161. editor while the file was checked out. EnterAct obeys these
  6162. resources (a "no pencil" icon appears in the window's display
  6163. box for read-only), and allows you to make changes to a
  6164. read-only file after you select the "Modify Read Only"
  6165. command.
  6166.  
  6167. Selecting "Ignore 'ckid's" in the Options dialog will force
  6168. EnterAct to completely ignore these resources. You’ll be able
  6169. to edit a file that was checked out as read-only, and the
  6170. SourceServer will never know. This can really screw things up.
  6171. Don’t do it. There, you’ve been warned.
  6172.  
  6173. §    Automark source files, Save source/headers marks
  6174. The "AutoMark source..." check box will create
  6175. marks for all functions in a source file when you open it,
  6176. and marks for struct and class definitions in headers.
  6177. The marks are redone (to pick up new functions etc) when
  6178. you save the files.
  6179. “Automark source/headers...” is ON by default.
  6180.  
  6181. You can force EnterAct to save source and header file markers
  6182. with your files by enabling the the “Save source/headers marks”
  6183. option, but the only use for this at present is to allow the
  6184. “Index Marker Names…” command to index marks in your source files.
  6185. “Save source/headers marks” is OFF by default.
  6186.  
  6187. §    Relocate files automatically
  6188. When this box is unchecked (the default), EnterAct will present
  6189. a dialog asking you to relocate a file whenever it loses track of
  6190. where a file is. This typically happens when you trash a whole
  6191. folder and replace it with a newer version. If you check this
  6192. box, then if EnterAct loses track of a file it will attempt to
  6193. relocate it without your help, by searching down from the top
  6194. level of the disk where it was last seen. If this doesn't work,
  6195. you'll still be asked to help.
  6196.  
  6197. Check the "Relocate files automatically" box only if you're sure that
  6198. each of your source files is uniquely named on the disk where you've
  6199. stored it. If you can't guarantee that, then please leave the box unchecked,
  6200. and put up with the occasional request to relocate a file -- it's no
  6201. more painful than resetting file paths with Code Warrior.
  6202.  
  6203. Note that if you just move a folder around on the same disk,
  6204. or rename a folder, EnterAct will still keep track of where
  6205. the contained files are. To make EnterAct lose track of a file,
  6206. you have to move it to a different folder, including the case of
  6207. trashing a folder and replacing it with one that has the same name.
  6208. (What about renaming the file? From EnterAct's point of view,
  6209. if you rename a file then it's a different file, and you'll have to
  6210. add it separately to your project.)
  6211.  
  6212. WATCH OUT for the wonderfully weird scenario in which you have
  6213. files with the same names in two different folders, and you want
  6214. to use SOME files from one folder, SOME from the other. Only MPW
  6215. among current development environments would let you keep track
  6216. of files accurately in this case, and EnterAct isn't up to it. Oh, your
  6217. EnterAct project would start out OK, but if you ever forced EnterAct
  6218. to ask you to relocate a file then I'm I'm telling you right now to
  6219. trash that project and build a new one. No one who wants to preserve
  6220. their sanity does this sort of thing, so think of this as a public service
  6221. message from your local Code Police.
  6222.  
  6223. -    -    -    -    -    -    -    -    -    -    -    -
  6224. Switching to other applications
  6225. -    -    -    -    -    -    -    -    -    -    -    -
  6226. §    Under the Finder (System 6)
  6227. There are some nifty INIT’s that will let you switch between
  6228. applications under the Finder almost as quickly and easily as if you
  6229. were using MultiFinder—On Cue and Master Juggler come to mind.
  6230. (OK, you got me - this manual was started in 1990, and there are
  6231. a few "fossils" here and there....)
  6232.  
  6233. Whatever means you employ to switch to another application from
  6234. EnterAct while under the Finder, you will be asked if you wish to save
  6235. any documents that need saving, and they will all be closed. The
  6236. situation with MultiFinder (or System 7) is different , since documents
  6237. can be left open when switching to another application.
  6238.  
  6239.  
  6240. §    Under MultiFinder (or System 7)
  6241. If you switch from EnterAct to some other application while under
  6242. MultiFinder or System 7, you will not be required to close your
  6243. documents. This means that while using the other application you could
  6244. attempt to access documents that you have left open in EnterAct. If
  6245. this potential conflict weren’t handled, you could end up working with
  6246. two different versions of the same document, and inevitably you would
  6247. lose one version.
  6248.  
  6249. One solution to this problem would be to prevent you from opening that
  6250. document with any other application if it is left open in EnterAct.
  6251. This restrictive “my file and you can’t have it” attitude is
  6252. appropriate if an application is meant for use on a network, where
  6253. several people could want access to the same file at once.
  6254.  
  6255. However, EnterAct is not meant to be used on a network, so it does not
  6256. take this approach. Instead, when you switch, all open documents are
  6257. quietly saved if they need saving and have ever been saved before
  6258. (“untitled” documents present no problem—you can’t get at them with
  6259. another application). In addition, when you return to EnterAct,
  6260. EnterAct will check your disk to see if you have altered any of the
  6261. open documents while you were away—if so, they will be quietly
  6262. reloaded. EnterAct, if effect, opts for the “low man on the totem pole”
  6263. position when it comes to having control over file access, and does
  6264. the necessary behind–the –scenes work to allow you to leave files open
  6265. and still be able to open and change them with other applications.
  6266.  
  6267. To make this bulletproof, it will be safest if you close all text
  6268. documents when leaving the other application, since that other
  6269. application will typically not be able to compensate for files being
  6270. changed “behind its back” in EnterAct.
  6271.  
  6272. You can, if you wish, defeat this protection by unchecking the “Safe
  6273. switching under MultiFinder” option in the Options dialog. However,
  6274. EnterAct will not restrict access to open files when you switch, so
  6275. you will be entirely responsible for ensuring that you don’t end up
  6276. with two versions of the same file floating around. Closing all open
  6277. text documents before switching would be sufficient.
  6278.  
  6279.  
  6280.  
  6281.  
  6282.  
  6283.  
  6284.  
  6285.  
  6286.  
  6287.  
  6288.  
  6289.  
  6290.  
  6291.  
  6292.  
  6293.  
  6294.  
  6295.  
  6296.  
  6297.  
  6298.  
  6299. Safe switching protection can also be defeated on a per–switch basis,
  6300. by holding down any of the <Shift>, <Option>, or <Command> modifier
  6301. keys while you switch. Holding down a modifier key while you switch
  6302. out from EnterAct means that unsaved changes to files will be left
  6303. unsaved, and when you return to EnterAct any files open in EnterAct
  6304. that were changed elsewhere will not be updated for you on–screen.
  6305. Holding down a modifier key while returning to EnterAct will prevent
  6306. just the updating on–screen of any files that were changed elsewhere.
  6307. This is, on rare occasions, handy if you change a file with some other
  6308. application, realise you’ve made a mistake but can’t revert, and wish
  6309. to recover the version of your file that’s still open in EnterAct.
  6310.  
  6311. If you wish to have several people working on the same source
  6312. files at the same time with EnterAct, your best approach is to
  6313. use SourceServer or some other version of source control that
  6314. uses 'ckid's to mark files as modifiable or read-only.
  6315.  
  6316. §    Check the disk for changes
  6317. When you edit source (.c or .h) files that are in an EnterAct project
  6318. with some other application, select Update Dictionary when
  6319. you reopen the project to ensure that your dictionary is brought up
  6320. to date, unless you clearly recollect that you didn’t change anything
  6321. outside of a function body. This update typically takes only a few
  6322. seconds.
  6323.  
  6324. Only the project you have open will track which files are changed, so
  6325. if you switch to a different project you will also need to select
  6326. Update Dictionary to rebuild the dictionary if any .c or .h
  6327. files in the project were changed while the project was not open,
  6328. whether or not the files were changed with EnterAct.
  6329.  
  6330. Experience suggests that it's more efficient to update your EnterAct
  6331. dictionary when you notice that it's producing lookup that's out of
  6332. date (unless more than one person is involved, in which case you may
  6333. be better off doing the Update routinely).
  6334.  
  6335. §    Working with THINK C
  6336. This section describes working with THINK C as a separate application:
  6337. to use EnterAct as a replacement for THINK’s own editor (the “use
  6338. external editor” Edit option in THINK C version 6 or later) please see
  6339. Appendix 4.
  6340.  
  6341. If you adopt EnterAct as your C editor of choice, you’ll often change
  6342. several files with EnterAct over an extended period, and then switch
  6343. to THINK C to bring your application up to date. Fortunately, there
  6344. is no need to keep exact track of which files you change, since THINK
  6345. C’s Make command can do this for you. Call up the Make dialog, click
  6346. the “Use Disk” button, and, after the brief wait while THINK C checks
  6347. the modification dates of your project files, click the “Make” button
  6348. to bring your THINK C project fully up to date. If you remember exactly
  6349. which files were changed, you can instead select them one by one in
  6350. the project window and use the “Compile” command to update your THINK
  6351. C project.
  6352.  
  6353. Conversely, if you use THINK C to make some changes to your source
  6354. files, you can bring your EnterAct project fully up to date by
  6355. selecting the Update Dictionary command from the EnterAct
  6356. menu, as mentioned above. Note this step is not necessary if your
  6357. changes while in THINK C were restricted to function bodies, which
  6358. should often be the case. This is because EnterAct does nothing with
  6359. function bodies except check them for balance in a few key delimiters.
  6360.  
  6361. Editing files with THINK C, or any other editor besides EnterAct, will
  6362. compromise your ability to revert files to earlier versions with
  6363. EnterAct (see the “Show Activities” chapter). That’s worth remembering,
  6364. but in practice the need to revert a file is so rare that you shouldn’t
  6365. let it influence your editing.
  6366.  
  6367. -    -    -    -    -    -    -    -    -    -    -    -
  6368. Show activities
  6369. -    -    -    -    -    -    -    -    -    -    -    -
  6370. §    Introduction
  6371. EnterAct will, at your option, keep track of your recent activities
  6372. in full detail. The Show Activities command under the Edit menu
  6373. generates a window holding descriptions of those activities, with
  6374. details in plain English of what, when, and where. Here are three
  6375. typical entries from the “••Recent Activities••” window generated by
  6376. Show Activities:
  6377.  
  6378. ¶148
  6379. Tue Jan 12, 1993 8:22:23 pm OPEN «PICT saving»
  6380. ¬
  6381. ¶149
  6382. Tue Jan 12, 1993 8:23:17 pm CUT «PICT saving» 45 1 (temp)
  6383. <=deleted 289 characters:
  6384. «/* save pict "dataH" under the full path name "fileName", on
  6385. the volume "volumeName" */
  6386.     /* open the file, which should already exist */
  6387.     pb.ioCompletion = 0L;
  6388.     pb.ioNamePtr = (StringPtr)fileName;
  6389.     pb.ioVRefNum = 0;
  6390.     pb.ioVersNum = 0;
  6391.     pb.ioPermssn = 3; /* = fsRdWrPerm */
  6392.     pb.ioMisc = 0L;»
  6393. ¬
  6394. ¶150
  6395. Tue Jan 12, 1993 8:23:21 pm CLOSE «PICT saving»
  6396. ¬
  6397.  
  6398. —where, for example, “CUT «PICT saving» 45 1 (temp)” means characters
  6399. were cut from the document “PICT savings” starting at line 45 position
  6400. 1, and the cut was temporary, ie not saved to disk—if it had been,
  6401. there would have been a SAVE before the CLOSE. Both file names and data
  6402. are enclosed in European-style quotes «».
  6403.  
  6404. Activity records are kept on disk in the log file “EnterAct Recent
  6405. Activities”. This file is created and managed for you, and is preserved
  6406. between sessions. Your most-recent 10,240 activities will be recorded
  6407. in full detail, up to the limits of 65,535 characters per insert or
  6408. delete, and a total of 1,310,720 characters of inserts and deletes for
  6409. the 10,240 activities (typically only 1/4 or less of that is needed).
  6410. Everything of interest, including all edits, searches,
  6411. open/close/save/save as, switching in and out, etc will be recorded.
  6412.  
  6413. Armed with a display of your recent activities, you will typically be
  6414. able to:
  6415.     •    remind yourself of what you did recently (another form of “context
  6416.         restoration”)
  6417.     •    selectively undo or recover the contents of any recent insert or
  6418.         delete
  6419.     •    generate a reverted version of a file, back to a particular activity
  6420.         (multiple files can be done one file at a time, back to different
  6421.         activities)
  6422.  
  6423. To turn the recording of activities off temporarily, select the menu
  6424. item named Recording activities under the Edit menu: it will change
  6425. to read Not recording activities. This is a toggle, and selecting it
  6426. again will turn recording back on. Your recording status is remembered
  6427. between sessions.
  6428.  
  6429. If you’re just interested in a quick first look, skim through the
  6430. “What’s shown” and “Reviewing activities” sections later in this
  6431. chapter.
  6432.  
  6433. To revert one or more files, you’ll need to follow the checklist in
  6434. the “Reverting a file” section, since the procedure is relatively
  6435. lengthy. For other uses of the “••Recent Activities••” window, an
  6436. understanding of the format of a displayed activity is all you really
  6437. need. Many obvious points are explained at length below, both to scrub
  6438. away the fuzziness from some intuitive notions and to introduce you
  6439. gently to what is, at heart, a simple way of keeping track of what
  6440. you’ve done recently.
  6441.  
  6442.  
  6443. §    What’s recorded
  6444. Full details on the following activities are recorded in the log file
  6445. “EnterAct Recent Activities”:
  6446.     •    all edits which affect your text, including typing, Cut, Paste,
  6447.         Paste Selection Behind, Undo, and replacements done with any of the
  6448.         replacement commands under the Search menu. The only notable edit
  6449.         exception is Copy
  6450.     •    all search results, in one or multiple files
  6451.     •    session start and end, switching in and out, running a Drag_on Modul
  6452.     •    Open, Close, Save, Save As, Revert, for text, lookup, PICT, and
  6453.         project windows (when applicable)
  6454.     •    Go to, Go Back, Go to Top, Go to Bottom, and jumping to a definition
  6455.  
  6456. After starting EnterAct at least once, you’ll find your log file in
  6457. the same folder as EnterAct itself, and you’ll probably be able to
  6458. identify it as a “log” file just by its icon. Note that it is not a text
  6459. file, at least not entirely, and its contents can be shown only with
  6460. EnterAct’s Show Activities command.
  6461.  
  6462. For each activity, the following information will be recorded, if
  6463. appropriate:
  6464.     •    the name of the activity (eg TYPING, SAVE, RUN DRAG_ON MODULE)
  6465.     •    the time at which it occurred
  6466.     •    the name of the file in which it occurred
  6467.     •    the position in the file at which it occurred, specifically the
  6468.         starting position if it was an insert, delete, or Find of some sort
  6469.     •    for inserts and deletes, the full contents, and the size of the edi
  6470.     •    for search and replace, the found text and the replacement text
  6471.     •    for Save As only, the previous name of the window.
  6472.  
  6473. Inserts and deletes are recorded as separate activities, even if they
  6474. result from a single command. For example, pasting over a selection
  6475. will be recorded as a delete followed by an insert:
  6476.  
  6477. ¶7
  6478. Wed Jan 13, 1993 9:27:52 pm PASTE «Untitled-1» 1 1
  6479. <=deleted 35 characters:
  6480. «This text was deleted when pasting.»
  6481. ¬
  6482. ¶8
  6483. Wed Jan 13, 1993 9:27:52 pm PASTE «Untitled-1» 1 1
  6484. =>inserted 38 characters:
  6485. «This text was pasted over a selection.»
  6486. ¬
  6487.  
  6488. The recorded file position of an edit is of course the position as
  6489. calculated at the time the activity occurred. Thus, for example, if
  6490. you inserted some text at line 100, character position 3 in a file,
  6491. the recorded position will be line 100, position 3. However, a
  6492. subsequent edit before the position of that insert, for example a
  6493. delete of lines 20 through 29 in the same file, will alter the position
  6494. you would want to examine if you now went looking for that insert,
  6495. assuming you saved your file. Instead of finding the inserted text at
  6496. line 100, you would find it at line 90. This is called the “updated”
  6497. position of the activity. As you’ll see in “What’s shown” below, you
  6498. have the choice of showing either original or updated positions.
  6499.  
  6500.  
  6501. §    Recording limitations
  6502. EnterAct does not record activities carried out in other applications,
  6503. in particular changes to text files. Editing files with some other
  6504. editor (such as THINK C) will compromise your ability to recover
  6505. reverted versions of files using EnterAct’s multiple undo capability,
  6506. in the following ways:
  6507.     •    if the edits elsewhere involved adding or removing lines, you will
  6508.         probably not be able to usefully revert the file with EnterAct
  6509.     •    if the edits elsewhere were fairly small, and did not involve adding
  6510.         or removing lines, then you will probably be able to recover a useful
  6511.         reverted version with EnterAct, but the small changes you made
  6512.         elsewhere will not be reflected in the reverted version.
  6513.  
  6514. Only your most-recent 10,240 activities will be recorded in the
  6515. “EnterAct Recent Activities” log file. The contents of your inserts
  6516. and deletes will be recorded up to a limit of 1,310,720 characters
  6517. total for all activities. In addition,
  6518. inserts and deletes will be fully recorded only if they do not
  6519. exceed 65,535 characters. For edits exceeding this limit, only the
  6520. first 1,024 characters will be recorded for reference.
  6521.  
  6522. Typically:
  6523.     •    10,240 activities represents several days of work. If you want to
  6524.         estimate how far back your activity log goes, bear in mind that inserts
  6525.         and deletes are recorded as separate activities, a run of characters
  6526.         typed without changing the insertion point counts as a single insert,
  6527.         and usually for every insert or delete there is one activity of some
  6528.         other kind such as a save or search. For example, at 4 activities
  6529.         per minute on average, you'll be logging your last 40 hours.
  6530.     •    large edits are rare enough that you won’t run into the recording
  6531.         limits. Your average number of characters per activity will probably
  6532.         be under 50, and, if you’re slightly paranoid like the rest of us, you
  6533.         will probably deal will very large edits by using Save As rather than
  6534.         Cut and Paste.
  6535. Minor activities, such as scrolling or changing windows, are not
  6536. recorded.
  6537.  
  6538. To avoid cluttering your activity log, a Replace All that is just used
  6539. for counting purposes is not recorded in detail. 
  6540.  
  6541. Based on personal experience, the limitation that most affects the
  6542. quality of recorded activities is of the “is it plugged in?” variety.
  6543. If you turn recording off temporarily, remember to turn it back on
  6544. again later!
  6545.  
  6546.  
  6547.  
  6548. §    Showing your recent activities
  6549. Selecting Show Activities from the Edit menu produces the following
  6550. dialog:
  6551.  
  6552.  
  6553.  
  6554.  
  6555.  
  6556.  
  6557.  
  6558.  
  6559.  
  6560.  
  6561.  
  6562.  
  6563.  
  6564.  
  6565.  
  6566. Select the “updated current positions” button to have activity
  6567. positions updated as much as possible. Select the “originally recorded
  6568. positions” button to leave line numbers and character positions
  6569. unchanged from their originally recorded values. For review or single
  6570. undo, you’ll want updated positions, but in order to perform a multiple
  6571. undo the original positions are required.
  6572.  
  6573. You may show up to 10,240 of your recent activities, and as you alter
  6574. the number of activities to show the “Memory needed” display at bottom
  6575. of the dialog will update. Showing a few activities will take 700K
  6576. or so of memory, and showing all 10,240 may require a couple of
  6577. meg or more. If you will need more memory than is available, try
  6578. closing all windows including your current project.
  6579.  
  6580. When you click the OK button, a plain-English description of your
  6581. activities will be generated, and shown to you in a window titled
  6582. either “••Recent Activities••” if you selected original positions, or
  6583. “••Recent Activities (updated)••” if you selected updated positions.
  6584.  
  6585. If you’re only interested in your last few activities, adjusting the
  6586. number of activities to show to a small number will reduce the time
  6587. it takes to generate this description.
  6588.  
  6589. "Show full path names for files" is useful if you have more that one
  6590. file with the same name. This will require slightly more memory for
  6591. all that extra text.
  6592.  
  6593.  
  6594. §    What’s shown
  6595. Here’s are some typical entries selected from a “••Recent Activities••”
  6596. display:
  6597.  
  6598. ¶60
  6599. Sat Jan 16, 1993 10:51:48 pm PASTE «hAWK_FilesandClip.c» 390 4
  6600. =>inserted 50 characters:
  6601. «if (!dirs && !(fpb->ioFlAttrib & 16)) /* a file */»
  6602. ¬
  6603. ¶359
  6604. Sun Jan 17, 1993 5:53:14 pm SAVE AS «HuffCode.c»
  6605. Previous name was: «Untitled-1»
  6606. ¬
  6607. ¶858
  6608. Sun Jan 17, 1993 11:47:09 pm GO TO «EnterAct log» 1417 1
  6609. ¬
  6610. ¶868
  6611. Sun Jan 17, 1993 11:50:28 pm OPEN «CEDAR_Files.c»
  6612. ¬
  6613. ¶869
  6614. Sun Jan 17, 1993 11:50:28 pm FIND DEFINITION «CEDAR_Files.c» 3035 1
  6615. «GetSwitchOutTime»
  6616. ¬
  6617. ¶870
  6618. Sun Jan 17, 1993 11:50:43 pm FIND «CEDAR_Files.c» 43 23
  6619. «SwitchOutTime»
  6620. ¬
  6621. ¶926
  6622. Mon Jan 18, 1993 12:02:54 am SWITCH OUT 
  6623. ¬
  6624. ¶927
  6625. Mon Jan 18, 1993 12:07:31 am SWITCH IN 
  6626. ¬
  6627. ¶1001
  6628. Tue Jan 19, 1993 11:09:56 pm END OF SESSION 
  6629. ¬
  6630. ¶1002
  6631. Wed Jan 20, 1993 8:00:49 pm START OF SESSION 
  6632. ¬
  6633.  
  6634. The first line of the activity record begins with “¶”, and is followed
  6635. by the activity number. The oldest activity shown is number 1, followed
  6636. by later (younger) activities up to the last thing you did, and its
  6637. number may be as high as 10,240.
  6638.  
  6639. The second line of the activity record shows the date and time,
  6640. followed by the name of the activity. These are present for all
  6641. activities, and for some activities (such as SWITCH OUT ) that may be
  6642. all there is before the ending “¬”.
  6643.  
  6644. If the activity involves a file or window, its name will be shown next
  6645. inside European style «» quotes. And if the activity relates to a
  6646. specific position in the file, this will be shown after the file name.
  6647. The position is for the start of the activity, and consists of the
  6648. starting line number followed by the character position at which the
  6649. activity started on that line. The first line in the file is line 1,
  6650. and the position before the first character on a line is position 1.
  6651.  
  6652. The third and following lines hold the data, if any, associated with
  6653. the activity. For inserts and deletes, the data will be preceded by
  6654. either “<=deleted xx characters” or “=>inserted xx characters” where
  6655. xx is the number of characters. In rare cases where the entire edit
  6656. could not be recorded, this will be followed by a number telling how
  6657. many characters of the edit have been retained, for example
  6658.     =>inserted 98765 characters (1024 shown)
  6659.  
  6660. The contents of an insert or delete will be trimmed if:
  6661.     •    the edit exceeds 65,535 characters; in this case, only the first
  6662.         1,024 characters will be recorded
  6663.     •    total recorded data would exceed 1.3Meg; in this case the
  6664.         data recorded for the oldest edits will be progressively trimmed until
  6665.         enough room is freed up to record the newest edit. The governing
  6666.         assumption is that the older an edit is, the less important it is,
  6667.         regardless of size. This approach has been chosen so that you will
  6668.         retain multiple-undo capabilities as far back as possible.
  6669.  
  6670. The data associated with the activity is enclosed in European-style
  6671. quotes «», and no characters are appended or altered inside the quotes,
  6672. though as described above characters may on rare occasions be trimmed
  6673. from the end.
  6674.  
  6675. Each activity finishes up with a “¬”, on a line by itself.
  6676. The SAVE AS  activity has a special format, with the second line
  6677. containing SAVE AS  followed by the new file name, and the third line
  6678. giving the previous name of the window, with accompanying text that
  6679. makes this clear.
  6680.  
  6681. The number of activities shown will often fall a few short of the
  6682. number you requested (typically by 1 or 2 per 100). These “missing
  6683. activities” were originally records of your typing. A sequence of
  6684. characters typed without moving the insertion point other than by
  6685. typing counts as, and is recorded as,  a single activity. However,
  6686. there is no such Macintosh event as “end of typing”, and EnterAct is
  6687. slightly conservative in its estimate of when you have finished typing
  6688. in a particular spot. Basically, any recordable activity is treated
  6689. as an “end of typing” event if typing was going on. For example, a Save
  6690. while typing would trigger a recording of your typing up to that point.
  6691. If you then continue typing in the same place, that typing record will
  6692. later be deleted, and a complete record of all your typing in the same
  6693. place will eventually be made. Normally this is of no consequence, and
  6694. now that you know what’s happening you shouldn’t let it affect you in
  6695. the slightest.
  6696.  
  6697.  
  6698.  
  6699. §    Temporary, obsolete, and undone activities
  6700. Though not recorded, the “current relevance” of any activity which
  6701. refers to a specific place in a file is inferred when you Show
  6702. Activities. As a result of later activities up to the time at which
  6703. you show them, an earlier activity may end up being currently classed
  6704. as:
  6705.     •    permanent; the document in which it occurred was saved to disk after
  6706.         the activity in question (ie not closed without saving, or unsaveable
  6707.         such as a lookup window). More accurately, an activity is permanent
  6708.         unless it falls into one of the following categories. “Permanent” is
  6709.         the default category, and permanent activities are not indicated in
  6710.         any special way in activity records.
  6711.     •    temporary; the window in which the activity occurred was
  6712.         subsequently closed without saving, but some version of the document
  6713.         currently exists on disk, so that in principle at least the activity
  6714.         still has a recoverable context. 
  6715.     •    obsolete; not only was the window closed after the activity, but
  6716.         no reasonable version of the document now exists on disk. This can
  6717.         happen if you insert text into a new window and then close it without
  6718.         saving, or if you edit an unsaveable window (such as a lookup window).
  6719.         This can also happen when you use Save As to replace an existing file
  6720.         “OldFile” with a new version; at that point, all previous activities
  6721.         relating to “OldFile”, especially inserts and deletes, become obsolete
  6722.         since they were later overwritten by a new version and hence no longer
  6723.         have a recoverable context in any meaningful sense.
  6724.     •    undone; a permanent activity that was subsequently reversed with
  6725.         the Undo command. All temporary and obsolete edits have already been
  6726.         “undone”, in the sense that from the point of view of your disk files
  6727.         they never happened.
  6728.  
  6729. If a file is open when you select Show Activities, all edits from the
  6730. last save or open of that file up to the present will be classed as
  6731. permanent. However, if you subsequently close the file without saving
  6732. it and then reselect Show Activities, you will find that those edits
  6733. have been reclassified as temporary. And if you later save over the
  6734. file by using Save As, effectively replacing its contents with the
  6735. contents of some other file, then the activities will be reclassified
  6736. as obsolete.
  6737.  
  6738. If an activity is classed as temporary, obsolete, or undone, you’ll
  6739. see “(temp)", “(obs)", or “(undone)" respectively in the activity
  6740. record, following the file name and position numbers. Here are some
  6741. examples to help bring this into focus, each followed by a brief
  6742. explanation:
  6743.  
  6744. ¶25
  6745. Wed Jan 20, 1993 9:55:07 pm OPEN «HuffCode.c»
  6746. ¬
  6747. ¶26
  6748. Wed Jan 20, 1993 9:55:37 pm TYPING «HuffCode.c» 4 1 (temp)
  6749. =>inserted 69 characters:
  6750. «This text was typed into "HuffCode.c",and then the typing was     
  6751. undone.»
  6752. ¬
  6753. ¶27
  6754. Wed Jan 20, 1993 9:55:37 pm UNDO «HuffCode.c» (temp)
  6755. ¬
  6756. ¶28
  6757. Wed Jan 20, 1993 9:55:46 pm CLOSE «HuffCode.c»
  6758. ¬
  6759. (Note that the document “HuffCode.c” was closed without saving. The
  6760. typing is classed as temporary, which takes precedence over the undoing
  6761. of the typing. The same would be true of an obsolete edit that was
  6762. undone—it would be classed as obsolete.)
  6763.  
  6764.  
  6765. ¶31
  6766. Wed Jan 20, 1993 9:58:16 pm OPEN «Untitled-2»
  6767. ¬
  6768. ¶32
  6769. Wed Jan 20, 1993 9:58:46 pm TYPING «Untitled-2» 1 1 (obs)
  6770. =>inserted 87 characters:
  6771. «This text was typed into the window "Untitled-2", which was
  6772. then closed without saving.»
  6773. ¬
  6774. ¶33
  6775. Wed Jan 20, 1993 9:58:48 pm CLOSE «Untitled-2»
  6776. ¬
  6777. (Text was entered in a window that had never been saved to disk, and
  6778. then the window was closed without saving. The context of this activity
  6779. has been lost for good.)
  6780.  
  6781.  
  6782. ¶34
  6783. Wed Jan 20, 1993 9:59:51 pm OPEN «RenameTesttemp»
  6784. ¬
  6785. ¶35
  6786. Wed Jan 20, 1993 10:00:58 pm TYPING «RenameTesttemp» 1 37 (undone)
  6787. =>inserted 94 characters:
  6788. «
  6789. This text was typed into "Renametesttemp" and then undone.
  6790. The file was saved before closing.»
  6791. ¬
  6792. ¶36
  6793. Wed Jan 20, 1993 10:00:58 pm UNDO «RenameTesttemp»
  6794. ¬
  6795. ¶37
  6796. Wed Jan 20, 1993 10:01:01 pm SAVE «RenameTesttemp»
  6797. ¬
  6798. ¶38
  6799. Wed Jan 20, 1993 10:01:02 pm CLOSE «RenameTesttemp»
  6800. ¬
  6801. (Here, the undone typing in “RenameTesttemp” was turned into a
  6802. permanent activity by the following save. Only permanent undone
  6803. activities are shown as “(undone)”.
  6804.  
  6805.  
  6806. ¶47
  6807. Wed Jan 20, 1993 10:05:22 pm OPEN «Act1»
  6808. ¬
  6809. ¶48
  6810. Wed Jan 20, 1993 10:06:13 pm TYPING «Act1» 1 1
  6811. =>inserted 70 characters:
  6812. «This text was typed into "Act1", made permanent
  6813. by the following save.»
  6814. ¬
  6815. ¶49
  6816. Wed Jan 20, 1993 10:06:14 pm SAVE «Act1»
  6817. ¬
  6818. ¶50
  6819. Wed Jan 20, 1993 10:06:17 pm CLOSE «Act1»
  6820. ¬
  6821. (The typical case, activities that are made permanent by saving to
  6822. disk. There is no special indication for permanent activities, this
  6823. being the default class).
  6824.  
  6825. A permanent activity is there right now in your disk file or on-screen,
  6826. and you could, with a bit of work, undo it using the information in
  6827. the “••Recent Activities••” window—provided you can untangle it from
  6828. the effects of other permanent activities that followed it. An undone
  6829. activity was explicitly undone and the result saved, but you could redo
  6830. it in the same way you would undo a permanent activity. A temporary
  6831. activity wasn’t saved, but you could, with a bit of work, redo it using
  6832. the information in the “••Recent Activities••” window—provided you can
  6833. untangle it from the effects of other temporary activities that
  6834. preceded it. An obsolete activity no longer has a meaningful context:
  6835. the window or file in which it occurred no longer exists on screen or
  6836. disk, though if it was in a file you might have a backup version
  6837. somewhere.
  6838.  
  6839.  
  6840. §    Updated file names
  6841. When you edit a file and then use Save As to save it under a different
  6842. name, those preceding edits really apply to the file with the new name
  6843. rather than to the old name. As a typical example, when you open a new
  6844. window “Untitled-3”, type in it a bit, and then save it as
  6845. “FileCommands.c”, you will later remember the typing as being
  6846. associated with the name “FileCommands.c” rather than “Untitled-3”.
  6847. In the “••Recent Activities••” window, the file name for the typing
  6848. would be shown as “FileCommands.c”.
  6849.  
  6850. When you use Save As on a file, or Save a window for the first time,
  6851. the file name for preceding activities associated with the old name
  6852. will be updated to the new name. This updating is applied backwards
  6853. to the point where you opened or saved the affected document (or all
  6854. the way back if those activities are too old to be still recorded).
  6855.  
  6856.  
  6857.  
  6858. §    Reviewing activities
  6859. If you anticipate wanting to jump to a file that contains a particular
  6860. edit, in order to view it in context, click the “updated current
  6861. positions” while viewing the Show Activities dialog, so that the line
  6862. and characters positions shown will correspond to current actual
  6863. positions in your files (to the extent that this is possible). If you
  6864. just intend to skim through the activities without jumping to any
  6865. files, selecting the “originally recorded positions” button will speed
  6866. up the process of showing you your activities, at the expense of
  6867. showing you file positions that are uncorrected for other activities.
  6868.  
  6869. With the  “••Recent Activities••” window in front, you can use Find
  6870. to search for activities in the usual way. Here are some (rather
  6871. obvious) things you can search for:
  6872.     •    activity number, such as “¶314” (¶ is <Option><seven>)
  6873.     •    date, such as “Jan 13”
  6874.     •    time, such as “ 10:51” (put a space before the hour:minute to
  6875.         disambiguate it from minute:second)
  6876.     •    activity name, such as “START OF SESSION”
  6877.     •    file name (note including the European quotes «» sometimes helps)
  6878.     •    contents of an insert or delete
  6879.  
  6880. For activities with file positions, such as inserts and deletes and
  6881. search results, you can jump to the file and line by clicking on
  6882. the line with the file-line reference, and then picking Go to.
  6883. For example, given
  6884.  
  6885. ¶60
  6886. Sat Jan 16, 1993 10:51:48 pm PASTE «hAWK_FilesandClip.c» 390 4
  6887. ...etc
  6888.  
  6889. to open a window for hAWK_FilesandClip.c  and jump to line 390,
  6890. position 4 on the line, click somewhere on the line (for example,
  6891.  after the ‘»’…)
  6892.  
  6893.  
  6894. …and then pick “Go to”. For more details, see the “‘Go’ commands” chapter
  6895.  
  6896. With this use or any use of Go to, the file must be listed in one of
  6897. your project panes.
  6898.  
  6899. If you have selected the “updated current positions” version of your
  6900. activities, the Go to command will work reasonably well—in fact, it
  6901. will work as well as it possibly can. For example, if you
  6902. paste some text at line 100, and then paste in 10 lines at line 50,
  6903. then the position of the first paste will be updated from line 100 to
  6904. line 110, because that’s where you would find it if you went looking
  6905. for it now—provided it was a permanent activity. If you didn’t save
  6906. the file, thus rendering the activities temporary, then the updated
  6907. position of the first paste would still be line 100, because the
  6908. influence of the second paste was removed by virtue of not saving it.
  6909. In other words, to redo that first temporary paste, you would still
  6910. go to line 100.
  6911.  
  6912. The limit to which edit positions can be meaningfully updated shows
  6913. up for example when you delete a large chunk of text, and that deleted
  6914. chunk contained earlier inserts or deletes. If you paste some text at
  6915. line 100, and then delete lines 50 through 200, what should be the
  6916. updated position of the paste? EnterAct will show the updated position
  6917. as line 50, which, if you think about it, is the best that can be
  6918. done.The positions of obsolete activities are not updated, there being
  6919. no file or window to which the activity can be currently related.
  6920.  
  6921. §    Selective single undo
  6922. By selecting “updated current positions” when showing your activities,
  6923. you stand a very good chance of being able to identify the exact
  6924. current position of any previous insert or delete. However, the updated
  6925. position will not be terribly meaningful if the insert or delete was
  6926. later “engulfed” by a delete (for example a paste on line 100 followed
  6927. by deleting lines 50 through 200). And if the activity was an insert
  6928. that was later “nibbled at” by small inserts and deletes within the
  6929. original insert, you may find that you have to undo several activities
  6930. instead of one, or at least mentally compensate for them.
  6931.  
  6932. Once you have found the activity in the recent activities window, use
  6933. Go to to jump to the current position for the activity, as described
  6934. in the section above. If it still seems appropriate for undoing after
  6935. viewing it in context, the procedure for actually undoing it is, alas,
  6936. devoid of novelty:
  6937.     •    to undo an insert, identify the range of the insert in your document
  6938.         by comparing your document with the text of the insert as shown in your
  6939.         activity record; then select it and clear it out
  6940.     •    to undo a delete, copy the deleted text from your activity record
  6941.         and then paste it into your document at the current position for the
  6942.         activity.
  6943.  
  6944. If you have edited the document in question with some editor besides
  6945. EnterAct, the contents and positions of recorded activities may not
  6946. be entirely accurate. But if the edits elsewhere were small, you should
  6947. be able to compensate for them and still achieve the undo you want.
  6948.  
  6949. The recent activities window does not update as you make changes.
  6950. To force an update of positions and activities, close the window
  6951. and reopen it.
  6952.  
  6953. §    Reverting a file
  6954.  
  6955.     Introduction
  6956. The procedure for reverting a file to an earlier form based on your
  6957. recorded activities is a bit lengthy, so step-by-step instructions are
  6958. given below. In order to revert a file you need to specify the file,
  6959. and how far back you want to go when reverting the file. The “how far
  6960. back” part is specified by an activity number from your “••Recent
  6961. Activities••” window, so you’ll need to Show Activities (with original
  6962. positions) to identify the right activity number. The actual revert
  6963. is done with the supplied hAWK program “$Multi_Undo”, and to provide
  6964. the needed input for this program you’ll save your “••Recent
  6965. Activities••” window to disk, then add it to an EnterAct project. The
  6966. file you wish reverted must also be added to the same project. The
  6967. reverted file will be presented to you in the “$tempStdOut” window when
  6968. $Multi_Undo is finished, to do with as you wish.
  6969.  
  6970. EnterAct doesn't do version control, and this reversion process, in
  6971. its present inelegant form, should be used in emergencies only.
  6972. It works, but that's all you can say for it.
  6973.  
  6974.     Limitations
  6975. In order to revert a file (called file A below), several conditions
  6976. must be met:
  6977.     •    file A has been saved since its contents were last changed
  6978.     •    All changes to file A, from to the undo point up to the present,
  6979.         have been made with EnterAct
  6980.     •    From the undo point up to the present, no other file named "A" has
  6981.         been edited with EnterAct (ie a different disk or folder, but the same
  6982.         basic file name A)
  6983.     •    The activity corresponding to the undo point is present in
  6984.         EnterAct's "••Recent Activities••" window (it goes back up to 10,240
  6985.         activities).
  6986.     •    The entire text of each edit on file A is present in "••Recent
  6987.         Activities••": you normally won't want to check for this yourself, and
  6988.         the hAWK program “$Multi_Undo”, which you’ll be using anyway, will do
  6989.         it thoroughly for you. In general, only inserts or deletes below 64K
  6990.         characters are fully recorded, and older large edits near the beginning
  6991.         of "••Recent Activities••" may not be fully recorded if it was
  6992.         necessary to make room for newer large edits, due to the total data
  6993.         limit of 1.3Meg characters. Rule of thumb: barring a sequence of large
  6994.         edits, all of your edits will still be fully recorded. These size
  6995.         limits are only rarely encountered.
  6996.  
  6997. The reverted version of your file presented in “$tempStdOut” will not
  6998. retain any markers or illustrations from the original. Normally,
  6999. markers can be easily replaced with the Automark command. To reinstate
  7000. illustrations, you’ll need to use your resource editor to copy the
  7001. appropriate PICT’s.
  7002.  
  7003.  
  7004.     How to revert a file
  7005. If your circumstances meet the above conditions, you can revert a file
  7006. (still called “A”) by following these steps:
  7007.     1    Open an EnterAct project (any will do)
  7008.     2    If necessary, add file A to it
  7009.     3    Select "Show Activities..."; click on the "originally recorded
  7010.     positions" button; and for the number of activities to show, enter
  7011.     "10240"; and click the OK button to generate the "••Recent Activities••"
  7012.     window
  7013.     4    Locate the oldest activity you wish undone, and note its activity
  7014.     number -- this appears just afer the "¶" beginning the activity record,
  7015.     for example "¶314"
  7016.     5    Save "••Recent Activities••" somewhere - NOTE the name must start
  7017.     with two bullets, but is otherwise arbitrary, for example, "••RA" or
  7018.     "••For undo". The bullet character is <Option><eight>.
  7019.     6    Add your saved version of "••Recent Activities••" to your project,
  7020.     then close the window for "••Recent Activities••" to save memory
  7021.     7    Select both the saved version of "••Recent Activities••" and file
  7022.     A for MFS operations, by holding down the <Option> key and clicking
  7023.     on each name in the project window - a bullet • will appear beside the
  7024.     file name). These two should be the only files marked with a • in your
  7025.     project window
  7026.     8    Call up hAWK and select the supplied program “$Multi_Undo”; the
  7027.     input option should be "MFS selected files"; use "Set Variables" to
  7028.     set the value of the variable "howFarBack" to the activity number that
  7029.     represents how far back (inclusive) you wish to undo. For example,
  7030.              howFarBack=314
  7031.     to undo from the present (the largest activity number) back to and
  7032.     including activity number 314.
  7033.     9    Click the Run button. The undone version of file A will (eventually)
  7034.     be presented in the "$tempStdOut" window. You can continue working in
  7035.     EnterAct in the meantime.
  7036.     10    Save "$tempStdOut" under a different name if you wish to keep the
  7037.     results (see “Preserving the undone version” just below for an
  7038.     explanation)
  7039.     11    If there are other files you wish to restore, add them to your
  7040.     project if necessary, open your saved version of "••Recent
  7041.     Activities••" to determine how far back to undo, then close it and
  7042.     repeat steps 7-10 (especially step 10).
  7043. While you're waiting for $Multi_Undo to finish you should avoid editing
  7044. either file A or your saved version of "••Recent Activities••".
  7045.  
  7046. For more information on running hAWK programs see 
  7047. the “hAWK User’s Manual” supplied on disk.
  7048.  
  7049.  
  7050.     Preserving the undone version
  7051. The “$Multi_Undo” program stops one step short of actually reverting
  7052. your file, in that the reverted version is contained in the file
  7053. “$tempStdOut” at the end, rather than immediately replacing the
  7054. contents of your file. If you decide to keep the reverted version, you
  7055. can use Save As  on “$tempStdOut” to create a permanent copy of the
  7056. reverted file. You should do this before your next hAWK or Read
  7057. Resource run, because the file “$tempStdOut”, as its name suggests,
  7058. is overwritten with every Drag_on Module run.
  7059.  
  7060. If you use Save As to replace your file A with the reverted version,
  7061. this will not be undoable, and the unreverted version will be lost.
  7062. If you’re not absolutely sure that the reverted version should replace
  7063. the unreverted version, it’s best to give the reverted version a name
  7064. name that is close to the old one (eg the reverted version of
  7065. “MyEvent.c” could be called “MyEvent2.c” or “MyEvent_r1.c” etc).
  7066.  
  7067.  
  7068. §    Turning activity recording on and off
  7069.  
  7070.     Temporarily
  7071. When activities are being recorded you will see a menu item named
  7072. Recording activities under the Edit menu: it will change to read Not
  7073. recording activities if you select it, indicating that recording is
  7074. turned off. Selecting it again will turn recording back on. Even if
  7075. you are not recording activities, EnterAct will still open the log file
  7076. “EnterAct Recent Activities” each time you start EnterAct, creating
  7077. it if it is not found. And you will still be able to Show Activities.
  7078.  
  7079. Turning activity recording off temporarily is rarely useful. However,
  7080. you might consider it if you are about to perform a number of trivial
  7081. changes, or very large edits that you don’t need recorded, and want
  7082. to preserve the current record of your activities as much as possible.
  7083. But if you are aware that vitally important data exists only in your
  7084. recorded activities, it would be better to Show Activities and Save
  7085. the resulting activity list to disk, to avoid losing the data as older
  7086. activities are dropped from the log file.
  7087.  
  7088.  
  7089.     More permanently
  7090. The “master switch” for EnterAct’s activity recording is in the Options
  7091. dialog (under the Edit menu). 
  7092.  
  7093. You may wish to forego the recording of your activities if you don’t
  7094. have enough disk space available to hold the log file (2.1Meg), or if
  7095. your hard disk makes so much noise that you can’t work when it’s
  7096. active.  To turn off activity recording, and also instruct EnterAct
  7097. not to look for or create the “EnterAct Recent Activities” log file,
  7098. uncheck the “Save activities to disk” option in the Options dialog and
  7099. click the OK button: as you do so, the icon of the log file will be
  7100. crossed out, indicating that the file will no longer be needed or used.
  7101. You may then dispose of the log file if you wish, and EnterAct will
  7102. not complain.
  7103.  
  7104.  
  7105.  
  7106.  
  7107.  
  7108.  
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.  
  7124. To reactivate activity recording, check the “Save activities to disk”
  7125. option in the Options dialog and click OK. A log file will immediately
  7126. be created if one does not exist at the time. If the log file exists,
  7127. recording will pick up again with no loss of previously recorded
  7128. activities.
  7129.  
  7130.  
  7131. -    -    -    -    -    -    -    -    -    -    -    -
  7132. “Index” commands
  7133. -    -    -    -    -    -    -    -    -    -    -    -
  7134.  
  7135.  
  7136.  
  7137.  
  7138.  
  7139.  
  7140.  
  7141.  
  7142.  
  7143.  
  7144.  
  7145.  
  7146.  
  7147.  
  7148.  
  7149.  
  7150.  
  7151.  
  7152.  
  7153.  
  7154.  
  7155.  
  7156.  
  7157.  
  7158.  
  7159.  
  7160.  
  7161.  
  7162.  
  7163.  
  7164.  
  7165. (as of version 2.8, there is an additional "Check Prototypes"
  7166. command at the bottom of the Index list.)
  7167.  
  7168. The “Index” commands under the EnterAct menu generate a variety of
  7169. reports on your source code. With all except the Potential Locals
  7170. and Check Prototypes command, set up a multi-file selection first
  7171. to serve as input for the command. Potential Locals takes a function
  7172. body with parameters as input. Check Prototypes looks at all of
  7173. the function definitions and prototypes in your entire project.
  7174. All output from these commands is to $tempStdOut.
  7175.  
  7176. Functions… builds a list of functions in your selected files: it can
  7177. list functions defined in the files together with sublists of the
  7178. functions that each defined function calls, or conversely you can have
  7179. a list of all the functions called in your source code, together with
  7180. sublists showing which functions call them.
  7181.  
  7182. Cross-Reference… generates a cross-reference listing: you can specify
  7183. the types of term (function, struct, variable etc) to include, the
  7184. specific terms to look for (your current dictionary), and the files
  7185. to look in (your current multi-file selection). Supporting doc files
  7186. in your rightmost project pane can be included in the cross-reference.
  7187. You can also specify a list of common words (such as Handle) to skip
  7188. for cross-reference purposes.
  7189.  
  7190. #Includes and Marker Names generate lists of system or user headers,
  7191. and marker names in a variety of formats, in your selected files.
  7192.  
  7193. Potential Locals classifies and lists all terms in a function. Just
  7194. before this command, select the entire body of the function and the
  7195. parameters (ie from the opening ‘(’ of the parameters to the closing
  7196. ‘}’ of the function, inclusive). In the resulting list, names that have
  7197. no definition and are not parameters, and hence are probably local
  7198. variables, are listed first. The number of times each name was used
  7199. is also listed, and by comparing this list with your original function
  7200. you can quickly declare all necessary variables or eliminate
  7201. unnecessary declarations, and also spot spelling mistakes.
  7202.  
  7203. Standard Metrics issues counts of lines and characters in selected
  7204. files, and also shows character frequencies.
  7205.  
  7206. Check Prototypes is rather primitive, catching only a difference
  7207. in the number of parameters to a function. No need to bullet any
  7208. files, just bring your dictionary up to date beforehand. It's intended
  7209. for use with C source only, not C++.
  7210.  
  7211.  
  7212. §    Functions…
  7213.  
  7214.  
  7215.  
  7216.  
  7217.  
  7218.  
  7219.  
  7220.  
  7221.  
  7222.  
  7223.  
  7224.  
  7225.  
  7226. This command can be used to build a “skeleton” for selected source
  7227. files, a bare list of functions defined together with the functions
  7228. they call. It also works in reverse, and can be used to list all
  7229. functions that are called, together with sublists of the functions that
  7230. call them. Input is taken from your list of files selected for
  7231. multi-file operations (use the Find dialog buttons, or <Option>click
  7232. in the project window, see the “Search” chapter). Only files in the
  7233. left and middle project window panes will be looked at, and any files
  7234. you select in the right (documentation) pane will be ignored. You’ll
  7235. see results in “$tempStdOut”: if you decide you want to save the
  7236. results permanently, use Save As to save this document under a new name
  7237. of your choice, since the contents of $tempStdOut are overwritten by
  7238. every Index command or Drag_on Module run.
  7239.  
  7240. For proper results, your dictionary should be reasonably up to date
  7241. before using this command. In particular, your dictionary should
  7242. contain entries for all functions that you wish to see listed. For
  7243. example, in order for toolbox functions to show up in the listing
  7244. you’ll need to add the appropriate toolbox headers to your project and
  7245. update your dictionary.
  7246.  
  7247. When you select “with calls” in the Functions dialog, the main list
  7248. in the result will consist of functions defined in your list of source
  7249. files. Indented under each defined function will be a list of functions
  7250. called by the defined function. If you select “as defined” then
  7251. function definitions will be listed in the order encountered in your
  7252. source files, with a comment containing the file name beginning each
  7253. list for each file:
  7254.  
  7255.  
  7256.  
  7257.  
  7258.  
  7259.  
  7260.  
  7261.  
  7262.  
  7263.  
  7264.  
  7265.  
  7266.  
  7267.  
  7268.  
  7269.  
  7270.  
  7271.  
  7272.  
  7273.  
  7274.  
  7275.  
  7276.  
  7277.  
  7278.  
  7279.  
  7280.  
  7281. If you select "sorted” then all of the function definitions from all
  7282. files will be sorted alphabetically. In this case you can select
  7283. “include file locations” to list the defining file for each function:
  7284.  
  7285.  
  7286.  
  7287.  
  7288.  
  7289.  
  7290.  
  7291.  
  7292.  
  7293.  
  7294.  
  7295.  
  7296.  
  7297.  
  7298.  
  7299.  
  7300.  
  7301.  
  7302.  
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311. If you select “with callers” the resulting list will show all functions
  7312. that are called in your source code, with an indented sublist for each
  7313. naming the functions that call it. Here also, if you select “include
  7314. file locations” then the defining file name will be listed with each
  7315. function name.
  7316.  
  7317.  
  7318.  
  7319.  
  7320.  
  7321.  
  7322.  
  7323.  
  7324.  
  7325.  
  7326.  
  7327.  
  7328.  
  7329.  
  7330.  
  7331.  
  7332.  
  7333.  
  7334.  
  7335.  
  7336.  
  7337.  
  7338.  
  7339.  
  7340.  
  7341.  
  7342.  
  7343. With any function name, you can jump to the definition for it by
  7344. <Option> double-clicking on the name. File names in the listings are
  7345. enclosed in «» quotes: to open a file, click anywhere on the line
  7346. containing the file name and issue a Go to.
  7347.  
  7348.  
  7349. §    Cross-Reference…
  7350.  
  7351.  
  7352.  
  7353.  
  7354.  
  7355.  
  7356.  
  7357.  
  7358.  
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.  
  7377.  
  7378.  
  7379.  
  7380.  
  7381.  
  7382.  
  7383. The Cross-Reference command generates a cross-reference for all term
  7384. types you select, in all files selected for multi-file operations.
  7385. Names are listed in alphabetical order, with a sublist for each name
  7386. listing file name and line number for each instance, and optionally
  7387. the name of the function containing the instance. Only names that are
  7388. defined in your current project dictionary will be included in the
  7389. listing. Note that you can cross-reference supporting documents with
  7390. this command, by putting a bullet (•) beside the name of each
  7391. supporting document. The “include containing function names” option
  7392. will be ignored for support docs.
  7393.  
  7394. To generate a cross-reference just for names that are defined in
  7395. certain files, rather than all names defined in your current dictionary
  7396.     •    make a new project, and add to it only those source and header files
  7397.         which contain functions, variables, structs etc to be included in the
  7398.         cross-reference
  7399.     •    use Update Dictionary to build a dictionary for just those names
  7400.     •    add any additional files to be cross-referenced to your project
  7401.     •    place bullets (•) beside the names of all files you want to
  7402.         cross-reference
  7403.     •    select Cross-Reference
  7404.     •    optionally specify a file containing a list of common words to skip,
  7405.         with the “Skip words in…” button
  7406.     •    specify the term types (function, variable etc) to be included in
  7407.         the cross-reference, or click the “All types” button
  7408.     •    click OK and your desired list will appear in the $tempStdOut window
  7409. Normally your current project dictionary will be the appropriate one
  7410. to use for cross-referencing, and you won’t need to make a new project
  7411. just for this purpose.
  7412.  
  7413. As with all Index commands, use Save As to save $tempStdOut under a
  7414. different name if you decide to keep the results—$tempStdOut will be
  7415. overwritten by your next Index command or hAWK run.
  7416.  
  7417. The “Skip words in…” button in the Cross-Reference dialog allows you
  7418. to specify a list of words to skip, typically common names such as OK,
  7419. Handle, DialogPtr that you aren’t interested in. The names in the file
  7420. can appear in any order, and can be separated from one another by
  7421. spaces or <Return>’s. The file “Skip for XRef” which comes with
  7422. EnterAct contains a starter list. You’ll find it in the “hAWK Programs”
  7423. folder, which is inside the “Drag_on Modules” folder inside your
  7424. development folder.
  7425.  
  7426.  
  7427.  
  7428.  
  7429.  
  7430.  
  7431.  
  7432.  
  7433.  
  7434.  
  7435.  
  7436.  
  7437.  
  7438.  
  7439.  
  7440.  
  7441.  
  7442.  
  7443.  
  7444.  
  7445.  
  7446.  
  7447.  
  7448.  
  7449.  
  7450.  
  7451.  
  7452.  
  7453.  
  7454.  
  7455.  
  7456.  
  7457.  
  7458.  
  7459.  
  7460.  
  7461.  
  7462.  
  7463.  
  7464. To cancel the use of a skip-list, click the “Skip none” button.
  7465. When you select “include containing function names” the name of the
  7466. function, if any, containing each reference will be shown to the right
  7467. of each reference. Names which occur outside of a function body,
  7468. including all names encountered in support documents, will not have
  7469. a containing function listed.
  7470.  
  7471. The format of each reference such as
  7472. «AssocArray.c»        260        SetArrayValue
  7473.  is «file name» line-number containing-function (if any). To go to a
  7474.  particular reference, click on the reference line and use Go to. To
  7475.  jump to the definition of a containing function, <Option> double-click
  7476.  on its name.
  7477.  
  7478.  
  7479. §    #Includes…
  7480.  
  7481.  
  7482.  
  7483.  
  7484.  
  7485.  
  7486.  
  7487.  
  7488.  
  7489.  
  7490.  
  7491.  
  7492.  
  7493.  
  7494.  
  7495.  
  7496.  
  7497.  
  7498.  
  7499.  
  7500.  
  7501.  
  7502.  
  7503.  
  7504.  
  7505. To list header files that are included in one or more source or header
  7506. files:
  7507.     •    select the source and header files for multi-file operations
  7508.     •    select the #Includes… command
  7509.     •    pick either system headers with the <headers> button, or
  7510.         project-specific headers with the “headers” button, or both
  7511.     •    click OK, and the list will appear in the $tempStdOut window
  7512.     •    use Save As on $tempStdOut to make a permanent copy of the results.
  7513. Included file names are listed in the order encountered, together with
  7514. line number.
  7515.  
  7516.  
  7517. §    Marker Names…
  7518.  
  7519.  
  7520.  
  7521.  
  7522.  
  7523.  
  7524.  
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530.  
  7531.  
  7532.  
  7533.  
  7534.  
  7535.  
  7536.  
  7537.  
  7538.  
  7539.  
  7540.  
  7541.  
  7542.  
  7543.  
  7544.  
  7545.  
  7546. To list the names of all markers in one or more files:
  7547.     •    select the files (any panes) for multi-file operations
  7548.     •    select the Marker Names… command
  7549.     •    pick your preferred format for the names
  7550.     •    click OK, and the list will appear in the $tempStdOut window
  7551.     •    use Save As on $tempStdOut to make a permanent copy of the results.
  7552. The «file-name»«marker-name» format is useful for establishing “go to”
  7553. links, as explained in the “‘Go’ commands” chapter. The other two
  7554. formats can also be used as “go to” links, but work only within the
  7555. file that contains the marker.
  7556.  
  7557. EnterAct's default behavior is to NOT save marks with source or
  7558. header files, so there will normally be no marks listed for these
  7559. files. In practise you will probably not need special  “go to” links
  7560. for functions or structs anyway, since <Option>double-clicking
  7561. on the name anywhere will take you to the definition. “Go to” links
  7562. are intended mainly for establishing hyperlinks to documentation
  7563. files (this manual is already redundant enuff, so please see chapter 17
  7564. for details on creating and using «file-name»«marker-name» links).
  7565.  
  7566. §    Potential Locals
  7567.  
  7568.  
  7569.  
  7570.  
  7571.  
  7572.  
  7573.  
  7574.  
  7575.  
  7576.  
  7577.  
  7578.  
  7579.  
  7580.  
  7581.  
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.  
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.  
  7598.  
  7599.  
  7600.  
  7601.  
  7602.  
  7603.  
  7604.  
  7605.  
  7606.  
  7607.  
  7608. This command helps with the declaration of local variables. To use it,
  7609. first select the parameters and body of a function, from the opening
  7610. parenthesis of the parameters to the closing curly brace of the
  7611. function body, inclusive, as shown above left. Then select Potential
  7612. Locals:results will be shown in $tempStdOut.
  7613.  
  7614. Names are shown three per line, each followed by the number of times
  7615. the name was encountered in the function. The first list, “These look
  7616. most like locals:”, consists of those names seen in the function which
  7617. have no entries in your current dictionary, and hence they are the best
  7618. candidates to be local variables. Note, though, that they could also
  7619. be goto labels, or names that for some reason are not defined in your
  7620. dictionary. Names in this list with a frequency of 1 bear a close
  7621. look—often they have been used but not declared, or declared but not
  7622. used, or the name has a typo. Names in the other lists might also need
  7623. declaration as local variables, if you have used the same name for a
  7624. local and something else (such as a global variable, typically).
  7625.  
  7626.  
  7627. §    Standard Metrics
  7628. This command reports the total lines and characters in each of your
  7629. files selected for multi-file operations, followed by a C-style array
  7630. listing the number of times each character was seen. Comment characters
  7631. and lines are included in the totals, but blank lines at the end of
  7632. a file aren’t counted as lines.
  7633.  
  7634.  
  7635.  
  7636.  
  7637.  
  7638.  
  7639.  
  7640.  
  7641.  
  7642.  
  7643.  
  7644.  
  7645. <tab>
  7646. <CR>
  7647.  
  7648.  
  7649.  
  7650.  
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.  
  7659. §    Check Prototypes
  7660. This command checks all of the function definitions and
  7661. prototypes in your project dictionary, checking ONLY the
  7662. number of parameters for each function. It reports the
  7663. names of any functions that are declared with different
  7664. numbers of parameters. Before calling this command, you
  7665. should bring your dictionary up to date with Update Dictionary
  7666. for best results.
  7667.  
  7668. There is no need to select any files for multi-file operations
  7669. when using this command. You just need a project open with
  7670. a built dictionary.
  7671.  
  7672. This is a primitive version, and catches only differences in the
  7673. NUMBER of parameters to a function. And it's only for C files, not
  7674. C++. Don't trust it to validate prototypes, use it only
  7675. to spot the particular problem of the same-named
  7676. C function having a different number of parameters in
  7677. variant declarations. This typically happens when you change
  7678. the definition of a function and forget to change a prototype
  7679. for it in a different file.
  7680.  
  7681. If no prototypes are shown in stdout, your function definitions
  7682. and declarations all had a consistent number of parameters.
  7683. Or arguments, if you prefer. I won't argue.
  7684.  
  7685. -    -    -    -    -    -    -    -    -    -    -    -
  7686. Some thoughts on using EnterAct
  7687. -    -    -    -    -    -    -    -    -    -    -    -
  7688. (Worth mentioning again, EnterAct can be used as just a
  7689. "definition viewer" to help out other editors -- see
  7690. the end of "Lookup", chapter 10)
  7691.  
  7692. (As of September 95, the advice below about how to avoid lookup
  7693. delays and minimize memory use is sounding a bit dated; however,
  7694. it's stil true that smaller projects are easier to manage.)
  7695.  
  7696. §    Projects are cheap
  7697. EnterAct projects are quick and easy to create, the only real penalty
  7698. being the amount of disk space used. While an EnterAct project can be
  7699. truly enormous and still be usable, lookup will be faster and more
  7700. appropriate if you tailor your project to the problem at hand. As an
  7701. extreme example, here’s a generic project that would be perfectly
  7702. suitable for developing file–handling functions:
  7703.  
  7704.  
  7705.  
  7706.  
  7707.  
  7708.  
  7709.  
  7710.  
  7711.  
  7712.  
  7713. Lookup in this size project will always be instantaneous no matter how
  7714. bad your spelling, and lookup for your terms will never be confused
  7715. by accidental matches against terms in files that you don’t need
  7716. reference to. While accidental matches are not common, the speed of
  7717. lookup when your spelling is not exact does depend directly on the size
  7718. of your dictionary.
  7719.  
  7720. At the other extreme, you can create projects with files from more
  7721. that one application/driver etc. This can be very handy for comparing
  7722. different versions or different approaches to a problem. In practise,
  7723. the main penalty comes when you want to jump to a particular
  7724. definition, and there's more than one: to choose the one you want,
  7725. you have to press <Enter> to look it up and then <Option>double-click
  7726. in the lookup window.
  7727.  
  7728. The rule of thumb then is that an EnterAct project can consist of
  7729. whatever files you want, but performance will be better if you don’t
  7730. add files that you don’t need. There is a tradeoff between having
  7731. absolutely everything of potential interest in a large, complicated
  7732. project, and having several smaller but better–performing projects.
  7733.  
  7734. For ultra-compact project backup, in the event that some of your
  7735. projects are tedious to create:
  7736. •    select all of the files in your project for multi-file ops, by
  7737. clicking the "All" button in the Find dialog
  7738. •    select hAWK from the EnterAct menu, and select and run
  7739. the program "$EchoFullPathNames"
  7740. •    use Save As on the resulting stdout window to save your
  7741. list of project files
  7742. •    to recreate your project: create a New Project; hold
  7743. down the <Shift> key while selecting "Add Files..." (the menu
  7744. text will read "Add Files from List...") and select your text
  7745. file of full path names in the subsequent Open dialog; and
  7746. bring your dictionary up to date after the files are added.
  7747.  
  7748. §    Learning from or reviewing code
  7749. If your purpose is to explore rather than create, then you won’t be
  7750. typing in many incorrect spellings. Lookup when spelling is correct
  7751. is always instant, which is the case if you’re just reading through
  7752. code and looking up terms in the code as you go. In this case the only
  7753. restrictions on the size of the project are the amount of disk space
  7754. and RAM needed, and you can add absolutely all files related to the
  7755. application without slowing down the lookup.
  7756.  
  7757. (Strictly speaking, lookup is instant only for terms with entries
  7758. in your dictionary. Specifically, struct and class member names
  7759. are not separately entered in your dictionary, and it can take
  7760. a second or more for the AutoLook window to pull up a definition
  7761. that contains the member name. Sorry, there's no plan to speed
  7762. up member lookup. Member lookup won't hang you up, it will just
  7763. be stopped if you start typing or mousing around during the search.)
  7764.  
  7765. §    On documenting your work
  7766. There is little in this manual on the topic of documentation, primarily
  7767. because it’s up to you how, and how much, you document your work in
  7768. separate files. But it’s worth mentioning that EnterAct has a variety
  7769. of features to help you create and maintain your documentation. Here’s
  7770. a list:
  7771.     •    documentation files can be added to the rightmost pane of your
  7772.         project, for regular double-click access just like source and header
  7773.         files
  7774.     •    <Option> double-click or Find Definition can be used on any term
  7775.         that appears in your documentation to jump to its definition (provided
  7776.         of course that your dictionary is reasonably up-to-date)
  7777.     •    the AutoLook window will instantly update to display definitions
  7778.         of terms in your documentation (double-click on the term or click just
  7779.         after it). And clicking after a term and pressing the <Enter> key will
  7780.         produce a more persistent separate lookup window
  7781.     •    your own notes on various programming topics can be “disguised” as
  7782.         C terms, and in this form they can be built into your project
  7783.         dictionary for instant retrieval to the AutoLook window or a separate
  7784.         lookup window wherever the name of the note appears (see “Looking up
  7785.         your notes” in the “Lookup” chapter)
  7786.     •    Go to accepts file name followed by marker name, as explained in
  7787.         the “‘Go’ commands” chapter. These look like
  7788.         /* See «MY OOP Notes» «Static variables» */
  7789.         and the text for them can be generated by picking the marker from
  7790.         the popup menu in the document where it is defined while holding down
  7791.         the <Shift> key as well as the usual <Option> or <Command> key. The
  7792.         link location is maintained as you edit, since the marker’s location
  7793.         is maintained, and if the file and marker names are in «» quotes
  7794.         they can be abbreviated or even slightly incorrect and still work.
  7795.     •    Go to also accepts file-name and/or line-number selections. Text
  7796.         for this style of “go to” link is generated by the Show Activities
  7797.         command, and by a variety of supplied hAWK programs. For an example
  7798.         of line numbers used to index a document, see the “Active Index” at
  7799.         the bottom of the “hAWK User’s Manual” on disk 2.
  7800.     •    Reformat Selection can be used to even up the lines in one or more
  7801.         paragraphs of your documentation
  7802.     •    if you have any relevant PICT files, you can add them to your
  7803.         project for quick access. And Go to accepts PICT file names. You can
  7804.         also add one or more PICT’s as illustrations in a TEXT document (see
  7805.         “Illustrating your text” in the “Documents and windows” chapter).
  7806.     •    the hAWK program "$CompareFiles" can be run on any two of your
  7807.         project files to list differences.
  7808.  
  7809. EnterAct can track and link all of your supporting documentation. If
  7810. you develop naming conventions for your documents, and make use of some
  7811. of EnterAct’s linking power, you should find it’s a lot easier to keep
  7812. track of things. References will be just a double-click or Go to away,
  7813. which beats shuffling through a stack of papers or calling up an
  7814. accessory outliner all to heck (pardon the enthusiasm).
  7815.  
  7816. -    -    -    -    -    -    -    -    -    -    -    -
  7817. If there’s a problem
  7818. -    -    -    -    -    -    -    -    -    -    -    -
  7819. §    Out of memory
  7820. If you run out of memory while trying to do something, you’ll see an
  7821. Alert saying “Out of memory. Please close up and try again when things
  7822. are less busy.” or the equivalent. Open windows take up memory that
  7823. you can free by closing the window The project especially can
  7824. take a lot of memory (a Megabyte or more), since the entire dictionary
  7825. associated with it is kept in memory.
  7826.  
  7827. If you encounter frequent “Out of memory” messages, the least
  7828. inconvenient but most expensive cure is to add more memory to your
  7829. Macintosh. However, you can often free up a considerable amount of
  7830. memory by removing relatively unneeded files from your project. The
  7831. rough rule is that your project dictionary will take up in memory about
  7832. one–half of the disk space used by all .c and .h files in the project
  7833. (a better estimate, 16% of source files plus 120% of header files).
  7834. If you don’t need lookup for any of the terms in a .c or .h file,
  7835. removing it from your project will free up some memory. Note that plain
  7836. text files in the rightmost pane do not greatly affect memory used,
  7837. since they are not incorporated into the dictionary.
  7838.  
  7839. To see how much memory is free at any time, select Show Activities from
  7840. the Edit menu. At the bottom of the resulting dialog you will see the
  7841. amount of memory currently available.
  7842.  
  7843. For a guide to estimating memory needs and trimming unneeded files from
  7844. your project, see the file “EnterAct memory needs”.
  7845.  
  7846.  
  7847. §    Dictionary problems
  7848.  
  7849.     Missing dictionary entries
  7850. In rare cases, an error in your source may lead to a term not being
  7851. recorded in your dictionary, with no message. An example is
  7852.     int x        /* missing semicolon */
  7853.     long y;
  7854. for which EnterAct would record only the “y”, missing the “x”. This
  7855. is the one time that EnterAct’s tolerance of errors can be a nuisance,
  7856. but if you can remember where the term is defined then visual
  7857. inspection should reveal the error, typically a missing semicolon or
  7858. a missing or misspelled keyword. If you can’t remember where the term
  7859. is defined, and you really want lookup to be available for it, then
  7860. the one sure cure is to switch to THINK C and Compile or Check Syntax
  7861. until you spot and fix the bug.
  7862.  
  7863.  
  7864.     Trouble building your dictionary
  7865. If the dictionary–builder trips over a bug in your code and you can’t
  7866. spot the problem after reading this section and examining your code,
  7867. your next best course of action is to switch to THINK C and compile
  7868. the offending file. If you call for technical support and your code
  7869. is not compilable, there is only a small chance we can help, since the
  7870. possibilities would be too open–ended. Look on the bright side, you’ll
  7871. have to compile your code sooner or later anyway. 
  7872.  
  7873. EnterAct sets moderately strict standards for the part of your code
  7874. that is outside of a function, struct, or union body. However, code
  7875. that is inside of a function, struct, or union body is primarily
  7876. checked only for proper balance in a few key delimiters, typically {},
  7877. (), and /* */. As a result, almost all of your first–draft errors will
  7878. be simply ignored. Some errors outside of a body can be compensated
  7879. for, and the remainder that do trigger a complaint from the
  7880. dictionary–builder will almost always be fairly obvious.
  7881.  
  7882. Here follows a complete list of the messages you might see after
  7883. selecting Update Dictionary or Update For Front File Only. 
  7884.  
  7885.  
  7886. "Statement too complex to deal with all at once. Any chance you could
  7887. simplify?"
  7888. This message should be rather rare. You would have to nest brackets
  7889. more than 200 deep, or have more than 256 enum constants in a single
  7890. enum in order to produce it. I’m not giving an example! The cure would
  7891. be to reduce the number of brackets in your deeply–nested construction,
  7892. or split a monstrous enum into two parts.
  7893.  
  7894.  
  7895. "Typedef cannot have an init. One or the other has to go."
  7896.     typedef int SHORT = 7;
  7897. This should prove rare. “typedef” essentially creates a new keyword,
  7898. and you can no more initialize it than you could initialize “int”
  7899. itself. Apologies for stating the obvious.
  7900.  
  7901.  
  7902. "Illegal word or punctuation after struct or union."
  7903.     struct int myStruct {...     /* int */
  7904.     struct /myStruct {...        /* the '/' */
  7905.     struct myStruct (...}        /* wrong bracket */
  7906. Something between “struct” or “union” and the opening left brace (if
  7907. any) of the body doesn’t belong. Or, you may have neglected to type
  7908. in a name for the struct or union.
  7909.  
  7910.  
  7911. "Illegal word or punctuation after enum."
  7912.     enum Numbers int {...        /* int */
  7913.     enum /Numbers {...            /* the '/' */
  7914.     enum Numbers {one two three}; /* missing commas */
  7915.     enum Numbers {one, two; three}; /* that first semicolon */
  7916. Includes all the sorts of errors for a “struct” or “union”, and also
  7917. any error inside the body of the enum where the enum constants are
  7918. listed. EnterAct does not record any terms inside a struct or union,
  7919. but does record all enum constants, hence checking for an enum is more
  7920. strict. Some errors (such as an extra comma) can be shrugged off, but
  7921. most others will trigger this message.
  7922.  
  7923.  
  7924. "#if has no matching #endif, #else, or #elif."
  7925. I’m afraid you’re on your own tracking this error down, since it could
  7926. be anywhere in the file after the position shown. It could be due to
  7927. a misspelling, such as #eles, or the necessary “if–ender” could be
  7928. missing altogether.
  7929.  
  7930.  
  7931. "Function(?) has no name."
  7932.     long    (int x, char *tPtr);
  7933.     So, give the poor function a name.
  7934.  
  7935. "Pascal must be followed by a function."
  7936. “Pascal” or “pascal” indicates that a function passes arguments and
  7937. returns a value according to Pascal rather than C conventions. For more
  7938. on this topic, see your THINK C manual.
  7939.  
  7940.  
  7941. "Couldn't find end of initialization."
  7942.     struct MyStruct {int x; long y} instance = {4, 7L;
  7943. Typically this is caused by a missing or extra '}', as in the above
  7944. example. It could also be caused by a missing semicolon.
  7945.  
  7946.  
  7947. "Unbalanced statement. Use the Balance command right after OK'ing this
  7948. alert to diagnose the problem."
  7949. Since the Balance command checks all delimiters and shows you at least
  7950. one end of an unbalanced construction, finding the typo that caused
  7951. the lack of balance is usually straightforward. Selecting Balance a
  7952. second time can be useful—after the second Balance either you’ll be
  7953. shown a mismatch for the first delimiter or you’ll hear a beep
  7954. indicating that the other end is completely missing.
  7955.  
  7956.  
  7957. "Unbalanced or nested comment. Use the Balance command right after
  7958. OK'ing this alert to diagnose the problem."
  7959. EnterAct’s comment checking while dictionary–building (and balancing)
  7960. is even stricter than most compilers. For details, see the “Nested and
  7961. bad comments” section in the “Balance” chapter. As a byproduct of
  7962. dictionary–building, all source files in your project will be
  7963. thoroughly checked for comment errors.
  7964.  
  7965. If the problem is due to consecutive comment starts, and you want to
  7966. keep them because that’s the way you do things, select Options from
  7967. the Edit menu and uncheck the “Detect nested comment starts” check box.
  7968. This will partially disable EnterAct’s ability to trap comment
  7969. problems, both when building your dictionary and when balancing.
  7970.  
  7971.  
  7972. "Lack of balance in parentheses (). Use the Balance command right after
  7973. OK'ing this alert to diagnose the problem."
  7974. See above, Unbalanced statement....
  7975.  
  7976. "Unbalanced single or double quotes. Use the Balance command right after
  7977. OK'ing this alert to diagnose the problem."
  7978. See above, Unbalanced statement....
  7979.  
  7980. "Unbalanced square brackets []. Use the Balance command right after
  7981. OK'ing this alert to diagnose the problem."
  7982. See above, Unbalanced statement....
  7983.  
  7984. "Left curly brace { is not preceded by struct, union, enum, =, or
  7985. function definition."
  7986.     typedef stork MyStruct {int x; long y};/* stork?struct? */
  7987.     long ShouldBeFunction{int x, long y); /* '{' vs '(' */
  7988. Either the '{' should be something else, such as a '(', or a keyword
  7989. just before the '{' is missing or badly misspelled. EnterAct can handle
  7990. some typo’s, such as typdef sturct... but at some point (such as
  7991. twerpdeaf stork) has to give up and complain.
  7992.  
  7993.  
  7994. "Colon must signal class name, method name, or low-memory global."
  7995. Note this exludes some uses of the colon which are irrelevant for
  7996. dictionary–building, such as bit fields and any usage inside a function
  7997. body.
  7998.  
  7999.  
  8000. "Something is wrong at or near the position shown. Sorry,
  8001. if you can't fix the problem please email tech support.."
  8002. A Shakespearean sonnet will trigger this message. In general, the error
  8003. lies outside of EnterAct’s area of competence. Check for typo’s at or
  8004. near the position shown in the file. This message corresponds to the
  8005. “Syntax error” message that compilers issue when they give up and don’t
  8006. have a clue what’s going on.
  8007.  
  8008. My favourite way to generate this error is to accidentally add a junk
  8009. file with a name ending in .c or .h to a project. A reminder, Add All
  8010. In Folder inhales every text file in a folder.
  8011.  
  8012. This message can also be triggered by a preprocessor conditional that's
  8013. too tough for EnterAct to handle without your help -- see
  8014. "DON’T GIVE UP" near line 108 in this file, and also "Source code
  8015. restrictions", chapter 7, for the details. The symptom here is often
  8016. that the indicated error position is within a function body, an unusual
  8017. case because EnterAct's parser does almost nothing with function
  8018. bodies except check them for balance -- this means the parser ran
  8019. past the start of the function without seeing it. If you spot the usage
  8020. of a macro just above the function, and the usage does not end with
  8021. a semicolon, try entering the name of the macro in the "Macro's to
  8022. skip..." dialog. This usually fixes the problem.
  8023.  
  8024.  
  8025. "Function body was expected but not found at the position shown."
  8026. This typically results from a missing left brace '{' at the start of
  8027. a function. Rarely, it can be caused by an excess semicolon in an
  8028. “old–fashioned” style function definition, between the list of
  8029. arguments in round brackets and the start of the function body, eg:
  8030.     int myFunc(x,y)
  8031.     int x;
  8032.     long y;; /* extra semicolon */
  8033.     {...}
  8034. The dictionary–builder counts up your arguments, and won’t allow more
  8035. semicolons than you have arguments.
  8036.  
  8037.  
  8038. §    Lookup problems
  8039. For background, here’s a list of common errors that may throw regular
  8040. lookup off:
  8041.     1    using a synonym
  8042.     2    full spelling when a nonstandard abbreviation is wanted
  8043.     3    use of an abbreviation when fuller spelling is wanted
  8044.     4    full spelling when a standard abbreviation is wanted
  8045.     5    case error
  8046.     6    permutation of the words in a name
  8047.     7    typo
  8048.     8    spurious extra character
  8049.     9    homonym (sounds the same, spelled differently)
  8050.     10    missing definition, due to an error in the source or source file
  8051.     not included etc
  8052. Regular lookup can compensate for the more popular single instances
  8053. of 1-3 above with the lookup table of alternate spellings that you’ll
  8054. find in EnterAct’s 'TEXT' 1000 resource. Single instances of 4-5 are
  8055. thoroughly checked (see next page for the definition of a standard
  8056. abbreviation). An instance of error 6 is also caught, provided there
  8057. are at most four words making up the name. For all other errors (7-10,
  8058. or combinations of errors) EnterAct exhaustively checks what you’ve
  8059. typed against all dictionary entries, totalling up runs of matching
  8060. characters and showing the best matches. If the definition is just
  8061. plain missing, there’s not much that EnterAct can do to help.
  8062.  
  8063. “Sounds like” lookup is extremely error-tolerant, including being
  8064. case-insensitive, at the expense of ignoring some of the information
  8065. (mainly vowels and case) in what you type. It does do the fast checks
  8066. for errors 1-6 above, in the same way as regular lookup. On average
  8067. it’s less accurate than regular lookup, but useful as a last resort.
  8068.  
  8069. Reverse lookup tolerates only case errors, being case-insensitive;
  8070. otherwise, your spelling must be exact (current machines are too slow
  8071. for error-tolerant reverse lookup, and in any case it would be too
  8072. hyperactivated).
  8073.  
  8074.  
  8075.     Memory failure (yours, that is)
  8076. The term is in your dictionary but you can’t remember the spelling well
  8077. enough to retrieve it? Here are some guidelines to follow:
  8078. •    Nearly every name in your dictionary will have some distinctive part
  8079.     that uniquely identifies it, both from your point of view and
  8080.     EnterAct’s. Spell the distinctive part right, and you’ve got it.
  8081. •    If a name consists entirely of common words (Handle, Get, etc) you’ll
  8082.     have to spell more of the name correctly to help EnterAct distinguish
  8083.     among the possibilities.
  8084. •    If in doubt, spell it out. If there’s no exact match, EnterAct will
  8085.     try all standard abbreviations of each of the words in the name.
  8086. •    When you abbreviate part of a name in your source code, try to follow
  8087.     one of these standard abbreviation rules: 1) starting from the end of
  8088.     a word, drop vowels, and when all vowels are gone start over at the
  8089.     end and drop consonants; 2) truncate the word without regard for
  8090.     vowels; 3) either of the above rules, but keep the last letter of the
  8091.     word. If you follow any of these rules and leave at least 3 characters
  8092.     in the abbreviation then EnterAct will be able to generate the
  8093.     abbreviation from the full spelling, producing instant lookup (eg
  8094.     commandKey will retrieve cmdKey, by applying rule 1 but keeping the
  8095.     last letter of command).
  8096. •    If lookup for the name is immediate but wrong, add a spurious
  8097.     uncommon character at the beginning of the name and try again (if name
  8098.     doesn’t work try zname or xname to force a full search).
  8099. •    Use the Options dialog to increase the number of entries kept per
  8100.     lookup window to 10 or more, and try again.
  8101. •    A single case error will be shrugged off, but otherwise regular
  8102.     lookup is case–sensitive (eg CmdKey or cmdkey will retrieve cmdKey
  8103.     immediately, but CMdKey or CMDKey won’t). If you think you have several
  8104.     case errors, try “sounds like” (<Option><Enter>) lookup instead of
  8105.     regular lookup.
  8106.  
  8107.  
  8108.     Lookup fails
  8109. You know the term should be in your dictionary but even typing its
  8110. exact name doesn’t retrieve it? This is rare, and is caused by EnterAct
  8111. misinterpreting an error in your source code. Looking at the statement
  8112. where the term is defined or mentioned in your source code will usually
  8113. reveal a simple error such as a missing semicolon or a misspelled
  8114. keyword. If not, switch to your compiler and compile your code until
  8115. you’ve cleared any bugs in the statement where the term occurs.
  8116.  
  8117.  
  8118.     Miscellaneous lookup problems
  8119. In the rare case that your dictionary is small and the name you type
  8120. doesn’t match any term in the dictionary to any reasonable extent,
  8121. you’ll just hear a beep and no lookup will appear.
  8122.  
  8123. The hint for #defined macros is the same as the hint for other
  8124. #defines—add a '#' after the name, rather than a '('. In general, if
  8125. the lookup you see is not what you wanted and you supplied a
  8126. one–character hint, try again without the hint.
  8127.  
  8128. Looking up classes and methods is discussed in more detail in the
  8129. “Browsing” chapter.
  8130.  
  8131. If you suspect your spelling may be way off, try increasing the “Number
  8132. of entries per lookup window” in the Options dialog to 10 or more, and
  8133. then try the lookup again.
  8134.  
  8135. If you’re quite sure that a term should be in your dictionary but it
  8136. doesn’t appear when you look it up, take a look at the statement where
  8137. the term is defined or mentioned: you could have accidentally violated
  8138. a required coding convention (unlikely), or you could have a succession
  8139. of first–draft errors that has confused EnterAct. A missing semicolon
  8140. or misspelled keyword can sometimes result in a term being skipped.
  8141.  
  8142. If you employ macro’s to do such things as optionally include or omit
  8143. full prototypes, or typedef’s, then you should register them with
  8144. EnterAct using the Macro's to skip command, as described in the “Source
  8145. code restrictions” chapter.
  8146.  
  8147. If you run into a problem that stumps you, please compile your code
  8148. in THINK C before calling for help. However, if you end up fixing bugs
  8149. in your code that you feel EnterAct should have been able to tolerate,
  8150. please call and let us know.
  8151.  
  8152.  
  8153. §    Editing problems
  8154. EnterAct has a single level of undo, and the window that the undo
  8155. applies to must be in front in order for the Undo command to be
  8156. enabled. 
  8157.  
  8158. To undo a Paste Selection Behind, the window pasted into must be in
  8159. front, and the window copied from must be just beneath, the way
  8160. EnterAct leaves them after carrying out the command. If you can
  8161. remember which two windows were involved in the Paste Selection Behind,
  8162. just bring them to the front alternately until the Undo is enabled.
  8163.  
  8164. If Paste doesn’t preserve your indentation, it’s because you’re leaving
  8165. some text at the left of the first line unselected when you select a
  8166. range or insertion point for the Paste. In particular, Paste won’t
  8167. preserve indentation if you select an insertion point for the Paste
  8168. that is to the right of the first visible character on the line
  8169. (“visible character” here meaning something that is not a space or
  8170. tab). While we’re on the subject, you can switch off the preservation
  8171. of indentation for a Paste by typing a single character just before
  8172. you Paste, and then deleting it after.
  8173.  
  8174.  
  8175. §    Balance problems
  8176. If lack of balance is caused by mismatched delimiters, such as '{'
  8177. matched against ']', then by repeatedly selecting Balance you can
  8178. toggle between the two mismatched delimiters.
  8179.  
  8180. If the unbalance is due to a missing delimiter, keep in mind that
  8181. EnterAct handles comments properly, so the error will not be due to
  8182. an extra delimiter inside a comment. For example, a comment such as
  8183.     /* 1) load
  8184.         2) decrement
  8185.         3) store
  8186.     */ 
  8187. won’t trigger an error, unless you start with an insertion point or
  8188. selection that is inside the comment.
  8189.  
  8190. If you’re attempting to balance a closing delimiter and Balance has
  8191. to run backwards through an “asm {..}” block while searching for the
  8192. matching opener, you might get a spurious error due to something in
  8193. an assembly–language comment—see the “Balance” chapter in “The asm
  8194. problem” section for details.
  8195.  
  8196. If the problem is due to consecutive comment starts, and you want to
  8197. keep them because that’s the way you do things, select Options from
  8198. the Edit menu and uncheck the “Detect nested comment starts” check box.
  8199. This will partially disable EnterAct’s ability to trap comment
  8200. problems, both when building your dictionary and when balancing.
  8201.  
  8202. When you Balance an entire file, you will hear a beep whether or not
  8203. the file balanced, just to tell you that the balancing is finished.
  8204. If the cursor doesn’t move from the top of the file, that means the
  8205. entire file is balanced. If there is any error in the file, you will
  8206. be shown the first unbalanced delimiter.
  8207.  
  8208. When balancing just part of a file, you will hear a beep only if there
  8209. is an error. Otherwise, the selection range will quietly expand to the
  8210. next largest balanced range. If there is no larger enclosing range
  8211. (this is the case when you start with an entire function body selected,
  8212. for example) you’ll hear a beep but the selection range will not change
  8213.  
  8214. With the exception of strings, only two types of balance errors can
  8215. occur; mismatched ends, and missing ends. If Balance beeps and shows
  8216. you an unbalanced delimiter, try immediately selecting Balance again.
  8217. Then, if the problem is due to mismatched delimiters, you will be shown
  8218. the other end. If the problem is a missing end, nothing new will
  8219. happen—you’ll hear another beep, but the selected delimiter will not
  8220. change.
  8221.  
  8222. Strings in double quotes " " are checked for one additional special
  8223. error, a missing backslash if the string is continued across lines.
  8224. The backslash must be the very last character on the continued line,
  8225. just before the <Return>—note that even a space before the <Return>
  8226. will “hide” the backslash. Personally, I don’t think this is
  8227. reasonable, but that’s the way C is.
  8228.  
  8229. -    -    -    -    -    -    -    -    -    -    -    -
  8230. License agreement, tech support
  8231. -    -    -    -    -    -    -    -    -    -    -    -
  8232. §    Technical support
  8233. You can reach me (Ken Earle) at:
  8234.  
  8235. 73073,2166                                    via CompuServe,
  8236.  
  8237. 73073.2166@compuserve.com        via InterNet.
  8238.  
  8239. or via real-mail at:
  8240. Ken Earle
  8241. 697 Spadina Ave
  8242. Toronto, Ont
  8243. Canada M5S 2J1
  8244. (reply will be by e-mail, so please include a
  8245. CompuServe or InterNet address).
  8246.  
  8247. §    License
  8248. By using EnterAct, you are agreeing to abide by the
  8249. terms of this license. If you disagree, don't use it. If you agree,
  8250. send money, then come to disagree and want your money
  8251. back—well heck, everybody makes mistakes now and then,
  8252. just let me know what the problem is and you'll get your
  8253. refund. Do so within 60 days though, else I may deem that
  8254. EnterAct in your hands has already paid for itself several
  8255. times over.
  8256.  
  8257. This version of EnterAct carries a charge of zero dollars and
  8258. zero cents Canadian, so sending that in is optional.
  8259.  
  8260. Neither Apple Computer, Inc., nor Symantec Corporation make any
  8261. warranties, either express or implied, regarding the enclosed computer
  8262. software, its merchantibility, or its fitness for any particular
  8263. purpose. The exclusion of implied warranties is not permitted by some
  8264. governments. The above exclusion may not apply to you. This warranty
  8265. provides you with specific legal rights. There may be other rights that
  8266. you may have which vary according to location.
  8267.  
  8268. EnterAct and this manual are copyrighted, with all rights reserved.
  8269. You may distribute full copies of EnterAct (omitting no files from
  8270. the compressed archive that comprises EnterAct), provided you
  8271. do not charge for EnterAct itself.
  8272.  
  8273. In no event shall Dynabyte or any other legal entity involved in the
  8274. creation, production, or delivery of this product be liable for any
  8275. direct, indirect, consequential, or incidental damages (including loss
  8276. of data, lost business profits, business interruption, carpal tunnel
  8277. syndrome, and the like) arising out of the use of or inability to use the
  8278. software or accompanying material.
  8279.  
  8280. EnterAct does not support shared file access. If you use EnterAct on
  8281. a network, or as a member of a team working on the same source,
  8282. be aware that EnterAct will allow two or more people to open
  8283. one file with full read/write access. You must use some separate
  8284. form of source code control to avoid losing or accidentally
  8285. generating variant versions of files.
  8286.  
  8287. This agreement will be governed by the laws of the Province of Ontario
  8288.  
  8289. "hAWK", "Read Resource", their associated source code and
  8290. manuals, and the Drag_on Modules interface are yours to keep,
  8291. free, no matter what. They are governed by the Free Software
  8292. Foundation's "copyleft", as described in the document "copying
  8293. hAWK", included with your EnterAct package.
  8294.  
  8295. -    -    -    -    -    -    -    -    -    -    -    -
  8296. Appendix 1: Drag_on Modules
  8297. -    -    -    -    -    -    -    -    -    -    -    -
  8298.     Introducing Drag_on Modules
  8299. Drag_on Modules resemble HyperCard XCMD’s and MPW tools in that
  8300. they are separately–compiled chunks of code that are designed to
  8301. be called from within some application. The calling application is
  8302. at liberty to provide any of a dozen or so callback functions, which
  8303. mainly enhance text–oriented communication between the calling
  8304. application and Drag_on Modules, but these are all optional. The
  8305. calling interface has been kept simple, so that if you have an
  8306. application written in C or C++ you can add to it the ability to call
  8307. Drag_on Modules without hurting yourself—a day or two should do
  8308. it. Instructions for doing so can be found towards the end of the
  8309. “hAWK User’s Manual” and in the file “Call_Resource.c”. The
  8310. source code for “Minimal App7" illustrates the basic process. As
  8311. far as the callback functions go, if your application deals with
  8312. TEXT documents you’ll be able to support most of them easily, and
  8313. if you can’t support one then the Drag_on Modules will get along
  8314. without it.
  8315.  
  8316. The idea behind Drag_on Modules is to provide a medium for the
  8317. inexpensive modular distribution of source code that works best
  8318. when it is allowed to interact with full applications. Drag_on
  8319. Modules could easily be repackaged as separate applications, but
  8320. then the interaction with other applications would be slower. In
  8321. the absence of a universal “shell”, the next–best solution offered
  8322. by Drag_on Modules and the like is to let each application be a
  8323. shell. Admittedly, System 7 has promise as a universal application
  8324. coordinator, but while we’re waiting it’s nice to be able to achieve
  8325. the same effect with just 2K of overhead per application and the
  8326. extreme simplicity of file–based communication for major input
  8327. and output.
  8328.  
  8329. To help the illusion that there is a shell lurking in the background,
  8330. Drag_on Modules communicate by means of standard input, output, and
  8331. error files. This allows results from one Drag_on Module run to be
  8332. passed as input to a subsequent run, for example.
  8333.  
  8334. Two Drag_on Modules are currently being shipped, hAWK and Read
  8335. Resource.
  8336.  
  8337. Read Resource is just a simple resource or data fork viewer.
  8338.  
  8339. hAWK is a Mac implementation of AWK. You may have seen above
  8340. that hAWK has a "three clicks and Run" interface, and it's true:
  8341. for example, you could select hundreds of file as input to a
  8342. hAWK program by putting bullets beside them in your project
  8343. window, and then to call up the program: select "hAWK" from
  8344. the EnterAct menu; pick your program from the top popup;
  8345. optionally adjust the input option (all or part of the front file,
  8346. MFS-selected (ie bulleted) files, or a specific file -- this option
  8347. can be saved with the program, so normally there is no need to
  8348. change it); and then click Run. The program will run in the
  8349. background as you continue to work with EnterAct.
  8350.  
  8351. Added for version 3, you can now write hAWK programs that
  8352. watch EnterAct's clipboard, and, when your specified conditions
  8353. are met, write anything you like back to the clipboard. This
  8354. gives you in effect a "magic clipboard", ideal for reducing
  8355. repetitive, moderately complicated tasks to a simple Copy
  8356. and Paste. For details see the separate document
  8357. "EnterAct's magic clipboard".
  8358.  
  8359. Drag_on Modules come with complete source code. Complete code and
  8360. instructions for calling Drag_on Modules from your own application can
  8361. be found in the file “Call_Resource.c”, as supplemented by the example
  8362. of “Minimal App7".  If you are interested in creating your own Drag_on
  8363. Module, please see the “write your own Drag_on” folder.
  8364.  
  8365. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8366. Appendices 2 and 3 has been deleted. Instead, see the separate
  8367. documents "hAWK User's Manual" and "Read Resource Manual".
  8368. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8369.  
  8370. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8371. Appendix 4: EnterAct as THINK's editor
  8372. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8373.  
  8374. EnterAct can be used as a replacement for THINK’s own internal editor.
  8375. This means you can take full advantage of EnterAct’s features when
  8376. creating your documentation and source, and the THINK Project Manager
  8377. will be able to track all the changes you make as though you were using
  8378. its own editor.
  8379.  
  8380.  
  8381. §    Requirements
  8382. To use EnterAct as a replacement for THINK’s own internal editor, you
  8383. must have:
  8384. •    EnterAct 2.5 or later (you do)
  8385. •    THINK C 6 or later
  8386. •    System 7
  8387. •    about 2 Megabytes each for the THINK Project Manager and EnterAct.
  8388.  
  8389. §    Installing EnterAct as THINK’s editor
  8390. Create an alias of EnterAct, rename it “Editor”, and drop it into
  8391. the “Tools” or “(Tools)” folder inside your THINK C folder. Then
  8392. start up THINK Project Manager, and under the Project Managers’s
  8393. Editor options select “use external editor”—you’ll find this under
  8394. the Edit menu, in the “Editor” options for the Project Manager.
  8395. Recommended, deselect the “Reopen files” option in THINK’s Editor
  8396. options at this point, since EnterAct does a more thorough job of
  8397. reopening EnterAct project files, and this should prove to be all
  8398. you need.
  8399.  
  8400.  
  8401. §    Starting a session
  8402. Start the THINK Project Manager and open a THINK project in your usual
  8403. way. The first action you undertake that requires viewing a text file
  8404. will trigger THINK to start EnterAct. Most often you’ll double-click
  8405. on a file listed in your THINK project, but you might also select the
  8406. “Open” command, or double-click on the result of a batch find to view
  8407. a particular instance, etc. In all cases, when EnterAct starts up you
  8408. will be offered the opportunity to open an existing EnterAct project
  8409. or create a new one. After you’ve opened or created a project, or
  8410. cancelled, the text file will open in EnterAct.
  8411.  
  8412.  
  8413. §    Working with EnterAct as THINK’s editor
  8414. EnterAct and THINK projects serve different purposes, and typically
  8415. even hold different lists of files—an EnterAct project, for example,
  8416. can contain source files that are included for reference only, and
  8417. system and other header files can be explicitly listed in the project
  8418. window, and your dictionary updated for them, right from the moment
  8419. you create the project. So you’ll need an EnterAct project to handle
  8420. your code creation, documentation, and review, and a THINK project to
  8421. handle compiling and testing.
  8422.  
  8423.  
  8424. For the most part, when you want to compile or test you should be in
  8425. THINK, and when you want to edit or view files you should be in
  8426. EnterAct. To switch from EnterAct to THINK, click in your THINK project
  8427. window. To return to EnterAct, click in your EnterAct project window,
  8428. or any open text window that belongs to EnterAct. Though EnterAct may
  8429. be more tightly coupled to THINK in future versions, this simple
  8430. approach has the advantage that all of the THINK commands you use
  8431. regularly are still where you expect under your THINK menus, with one
  8432. extra click on your THINK project window required to place you back
  8433. in the right context for them.
  8434.  
  8435. Of course, opening any text file when in THINK will automatically
  8436. switch you over to EnterAct in order to display the file. And if a file
  8437. is listed in both your THINK and EnterAct projects, you can
  8438. double-click on either instance to open the file, with the same results
  8439.  
  8440. If all of your changes to source files have been made with EnterAct
  8441. acting as THINK’s replacement editor, or with THINK’s own editor, then
  8442. you can bring your THINK project fully up to date with the “Bring Up
  8443. To Date” command under THINK’s “Project” menu, and there is no need
  8444. to “Make” or “Scan Disk” to detect which files have changed. Your
  8445. EnterAct projects will typically need to be brought up to date only
  8446. for significant changes made outside of function bodies, and if all
  8447. changes were made with EnterAct you can use the Update Dictionary
  8448. command under EnterAct’s “EnterAct” menu.
  8449. Please note that both EnterAct and the THINK Project Manager will
  8450. automatically note changed files only for the project that is currently
  8451. open, and if some other project includes a changed file then you will
  8452. need to use THINK’s “Make” command or EnterAct’s Update Dictionary
  8453. to bring the project fully up to date.
  8454.  
  8455. In brief: there is nothing special you need to do when using EnterAct
  8456. as THINK’s editor.
  8457.  
  8458.  
  8459. §    Using THINK’s Find commands from EnterAct
  8460. Three commands at the bottom of EnterAct’s Search menu allow you to
  8461. invoke THINK’s Find commands: specifically, you can view the next or
  8462. previous matches from a batch find, or call THINK’s “Find In Next File”
  8463. command from EnterAct.
  8464.  
  8465. THINK Find Again and THINK Find Previous refer to the results of a
  8466. batch find done in THINK, and allow you to step through the matches,
  8467. viewing them with EnterAct. The batch find must first be carried out
  8468. in THINK, for which see your THINK User Manual.
  8469.  
  8470. THINK Find In Next File is the equivalent of returning to the THINK
  8471. Project Manager and selecting “Find In Next File”—once again, you will
  8472. need to use THINK’s Find dialog to set up the multi-file search
  8473. beforehand.
  8474.  
  8475. By the way, EnterAct’s own multi-file searching capabilities are
  8476. entirely independent of the THINK Project Manager’s. To do a straight
  8477. multi-file search, you should use EnterAct, since here it is slightly
  8478. easier to set up. For a batch find, you’ll need to set your search up
  8479. in the THINK Project Manager and then use THINK Find Again and THINK
  8480. Find Previous in EnterAct afterwards. (EnterAct also has a batch find,
  8481. but doesn't (yet) have the nifty Find Previous gizmoid. To jump to
  8482. a particular instance of one of EnterAct's finds, click on the line
  8483. reporting the find and use "Go to...".)
  8484.  
  8485. Find in THINK Reference does the same thing as the command of the
  8486. same name in the THINK Project Manager's editor: it passes your
  8487. currently-selected text over to THINK Reference, where you'll be
  8488. shown any entry it has on the name in question. Note this works only
  8489. with THINK Reference version 2 or later. For this command to work,
  8490. you need to have a folder named "Tools" or "(Tools)" next to EnterAct,
  8491. and drop an alias of THINK Reference in it.
  8492.  
  8493. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8494. Appendix 5: EnterAct and Code Warrior
  8495. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8496. By default, when you open a document and Code Warrior also has the
  8497. document open, EnterAct will put up a dialog giving you the options
  8498. of forcing Code Warrior to save and close the file before EnterAct
  8499. opens it, or of cancelling the Open. If you're not sure, return to
  8500. Code Warrior and decide whether or not to save the file. Note if
  8501. you do click "OK" to have EnterAct tell Code Warrior to save and
  8502. close the file, any changes to the file will not be undoable --after
  8503. all, it's not like editors these days have 10,000-level persistent
  8504. selective undo or anything. But shouldn't they?
  8505.  
  8506. As described elsewhere, EnterAct will by default save all
  8507. documents when you switch out, and refresh them from disk
  8508. when you switch back (only if needed of course). So there is
  8509. no decision to make when editing documents with Code Warrior
  8510. while EnterAct has the same documents open, since EnterAct will
  8511. have already saved them. When you switch back to EnterAct,
  8512. if you left the document open with Code Warrior you'll get that
  8513. dialog asking about forcing Code Warrior to save and close it,
  8514. or if you saved and closed the document before leaving Code Warrior
  8515. then EnterAct will just refresh the document from disk.
  8516.  
  8517. The "default" referred to above is the “Safe switching...” option
  8518. in EnterAct's Options dialog, which is on by default and saves your
  8519. documents when you switch out from EnterAct. Better to save too
  8520. often, since you can always revert with the “Show Activities”
  8521. command and a little cut and paste.
  8522.  
  8523. To use EnterAct as just a looker-upper with Code Warrior, see
  8524. "§    EnterAct as a "definition finder" for other editors" in the Lookup
  8525. chapter.
  8526.  
  8527. You can use EnterAct's multi-file search independently of Code
  8528. Warrior's, and EnterAct's is often handier because you can include
  8529. more files in your EnterAct project (all toolbox headers, or files
  8530. from several separate Code Warrior projects, or all Power Plant
  8531. files, for example).
  8532.  
  8533. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8534. 29  Appendix 6: the Scripts menu
  8535. -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
  8536. EnterAct itself understands only the four basic Apple events,
  8537. but you can use it to run any compiled AppleScript: just drop
  8538. the script in your "(EnterAct Scripts)" folder and it will
  8539. appear under EnterAct's Scripts menu (the next time you
  8540. start EnterAct). The scripts must be compiled, and should be
  8541. the sort that don't need any parameters or events to get going,
  8542. and that quit when they're done their specific task. Recompiling
  8543. your current CW or Symantec project is an example.
  8544.  
  8545. Any text your script puts in the AppleScript "result" variable
  8546. will be shown to you when the script terminates, in EnterAct's
  8547. stdout window.
  8548.  
  8549. To see it work, try the "Beep Once" script that's supplied. You should
  8550. see the stdout window after you hear a beep.
  8551.  
  8552. Event handling is minimal in EnterAct while a script is running: you
  8553. can interrupt a script with <Command><period>, and switch out of
  8554. EnterAct, but nothing else. The upshot is that scripts are appropriate
  8555. for running within EnterAct if they do something not too lengthy that
  8556. has to be done anyway before you can continue. Scripts that are to
  8557. run all the time or that take a very long time should be run some
  8558. other way (eg by double-clicking on the script itself).
  8559.  
  8560. (end)
  8561.